Custom module and method issue
Hello Experts,
I am facing a very strange situation, please share your knowladge if you had encountered such an issue.
I have created one sever method and now I want to call another module from this method. So, I have created interface and implementation classes for the module and deployed it to the docbase. Now, the problem is that, if I call this module using a Test class or using process builder, it runs without an issue.
If I call the method which should fire this module too, it fails to cast the implementation class to the interace.
=========================
2013-02-07 16:37:14,426 ERROR [STDERR] (http-0.0.0.0-9080-1) java.lang.ClassCastException: com.sinam.modules.PostApprovalCaseProcessingImpl cannot be cast to com.sinam.modules.PostApprovalCaseProcessing
My interface
=========================
package com.sinam.modules;import com.documentum.fc.client.IDfModule;import com.documentum.fc.common.IDfId;public interface PostApprovalCaseProcessing extends IDfModule { public void doProcessing(IDfId docObjId) throws Exception;}
My Implementation class
=========================
package com.sinam.modules;import com.documentum.fc.client.DfSingleDocbaseModule;import com.sinam.modules.PostApprovalCaseProcessing;public class PostApprovalCaseProcessingImpl extends DfSingleDocbaseModule implements PostApprovalCaseProcessing { @Override public void doProcessing(IDfId docObjId)throws Exception { System.out.println("Hello"); }}
My custom test method for firing the module
=========================
package com.sinam.test; import com.sinam.modules.PostApprovalCaseProcessing;import com.documentum.fc.common.DfId;import com.documentum.fc.common.IDfId;import com.documentum.fc.common.IDfLoginInfo;import com.documentum.fc.client.IDfSession;import com.documentum.fc.client.IDfSessionManager;import com.documentum.com.DfClientX;import com.documentum.com.IDfClientX;public class Test { public static void main(String args[]) throws Exception{ //Create a session IDfClientX clientx=new DfClientX(); IDfClient client=clientx.getLocalClient(); IDfLoginInfo logInfo=clientx.getLoginInfo(); logInfo.setUser("dmadmin"); logInfo.setPassword("--"); logInfo.setDomain(null); IDfSessionManager sessionManager=client.newSessionManager(); sessionManager.setIdentity("Test",logInfo); IDfSession session=sessionManager.newSession("Test"); System.out.println("New session created for docbase "+session.getDocbaseName()+" with ID "+session.getDocbaseId()); //Doc id IDfId docObjId=new DfId("09026c198000b134"); PostApprovalCaseProcessing pp= (PostApprovalCaseProcessing) client.newModule(session.getDocbaseName(), PostApprovalCaseProcessing.class.getName(), session.getSessionManager()); pp.doProcessing(docObjId); }}
There is no reason for it to fail, and I don't know why it fails in JMS but works in Test class.
Thanks in advance
Best Answer
-
Your problem can be relatd to classloader, so at first you should investigate where JMS loads
PostApprovalCaseProcessing
class from. The best way is run JMS JVM with -verbose:class option.0
Answers
-
Your problem can be relatd to classloader, so at first you should investigate where JMS loads
PostApprovalCaseProcessing
class from. The best way is run JMS JVM with -verbose:class option.0 -
Hello Expert,
Thank you very much. Right after your post, I turned on the option and found out that, the same interface class is being downloaded from docbase as part of two different jar files. After correcting this situation, it worked finally.
0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management