Connecting to documentum using java program
Hi All,
I am new to documentum & I am looking for the java program to connect to the documentum.
I found the below code:
// This will help you to connect to the repository <br/> IDfSessionManager createSessionManager(String docbase, String user, String pass)<br/> throws Exception {<br/> //create Client objects<br/> IDfClientX clientx = new DfClientX();<br/> IDfClient client = clientx.getLocalClient();<br/> <br/> //create a Session Manager object<br/> IDfSessionManager sMgr = client.newSessionManager();<br/> <br/> //create an IDfLoginInfo object named loginInfoObj<br/> IDfLoginInfo loginInfoObj = clientx.getLoginInfo();<br/> loginInfoObj.setUser(user);<br/> loginInfoObj.setPassword(pass);<br/> loginInfoObj.setDomain(null);<br/> <br/> //bind the Session Manager to the login info<br/> sMgr.setIdentity(docbase, loginInfoObj);<br/> //could also set identity for more than one Docbases:<br/> // sMgr.setIdentity( strDocbase2, loginInfoObj );<br/> //use the following to use the same loginInfObj for all Docbases (DFC 5.2 or later)<br/> // sMgr.setIdentity( * , loginInfoObj );<br/> return sMgr;<br/> }
<strong style="font-family: arial,helvetica,sans-serif;">I have included the dfc.jar in the class path. I run the program using the main()</strong>
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
IDfSessionManager dfSessionManager = createSessionManager("url","username","password");
System.out.println(dfSessionManager);
}
<strong> <span style="font-family: arial,helvetica,sans-serif;">I get the below exception:</span></strong>
Exception in thread "main" java.lang.NoClassDefFoundError: com/rsa/certj/cert/CertificateException
at com.documentum.fc.client.security.impl.InitializeKeystoreForDfc.execute(InitializeKeystoreForDfc.java:46)
at com.documentum.fc.client.security.internal.KeystoreMgr.initForDfcWithDefaultPolicy(KeystoreMgr.java:71)
at com.documentum.fc.client.security.impl.IdentityManager.initFromKeystore(IdentityManager.java:139)
at com.documentum.fc.client.security.impl.IdentityManager.<init>(IdentityManager.java:41)
at com.documentum.fc.impl.RuntimeContext.<init>(RuntimeContext.java:52)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:185)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:772)
at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:43)
at Test.createSessionManager(Test.java:46)
at Test.main(Test.java:36)
Caused by: java.lang.ClassNotFoundException: com.rsa.certj.cert.CertificateException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 10 more
If I put dfc.keystore from another application then the program fails connecting to the url information mentioned in the key store.
I am looking for solution for this program from past couple of days. Please help.
Comments
-
Hi Johnny,
I am not using the composer. I am using the java program in eclipse along with the dfc.jar and dfc.properties file. I am not sure whether we need the dfc.keystore file also.
I also found that we cannot connect to documentum from desktop because of the firewalls. Is it true?
Thanks
0 -
knavalg wrote:
Hi All,
I am new to documentum & I am looking for the java program to connect to the documentum.
I found the below code:// This will help you to connect to the repository <br/> IDfSessionManager createSessionManager(String docbase, String user, String pass)<br/> throws Exception {<br/> //create Client objects<br/> IDfClientX clientx = new DfClientX();<br/> IDfClient client = clientx.getLocalClient();<br/> <br/> //create a Session Manager object<br/> IDfSessionManager sMgr = client.newSessionManager();<br/> <br/> //create an IDfLoginInfo object named loginInfoObj<br/> IDfLoginInfo loginInfoObj = clientx.getLoginInfo();<br/> loginInfoObj.setUser(user);<br/> loginInfoObj.setPassword(pass);<br/> loginInfoObj.setDomain(null);<br/> <br/> //bind the Session Manager to the login info<br/> sMgr.setIdentity(docbase, loginInfoObj);<br/> //could also set identity for more than one Docbases:<br/> // sMgr.setIdentity( strDocbase2, loginInfoObj );<br/> //use the following to use the same loginInfObj for all Docbases (DFC 5.2 or later)<br/> // sMgr.setIdentity( * , loginInfoObj );<br/> return sMgr;<br/> }
<strong style="font-family: arial,helvetica,sans-serif;">I have included the dfc.jar in the class path. I run the program using the main()</strong>
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
IDfSessionManager dfSessionManager = createSessionManager("url","username","password");
System.out.println(dfSessionManager);
}<strong> <span style="font-family: arial,helvetica,sans-serif;">I get the below exception:</span></strong>
Exception in thread "main" java.lang.NoClassDefFoundError: com/rsa/certj/cert/CertificateException
at com.documentum.fc.client.security.impl.InitializeKeystoreForDfc.execute(InitializeKeystoreForDfc.java:46)
at com.documentum.fc.client.security.internal.KeystoreMgr.initForDfcWithDefaultPolicy(KeystoreMgr.java:71)
at com.documentum.fc.client.security.impl.IdentityManager.initFromKeystore(IdentityManager.java:139)
at com.documentum.fc.client.security.impl.IdentityManager.<init>(IdentityManager.java:41)
at com.documentum.fc.impl.RuntimeContext.<init>(RuntimeContext.java:52)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:185)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:772)
at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:43)
at Test.createSessionManager(Test.java:46)
at Test.main(Test.java:36)
Caused by: java.lang.ClassNotFoundException: com.rsa.certj.cert.CertificateException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 10 more
If I put dfc.keystore from another application then the program fails connecting to the url information mentioned in the key store.
I am looking for solution for this program from past couple of days. Please help.You need additional jar files, not just dfc.jar. Try adding certj.jar from DFC to the classpath, the error should change.
0 -
Bare bones dfc program needs at least 5 or 6 jars. Sorry can not remember which one's. Trial and error, keeping adding until no more problems
dfc.keystore should not be copied from another location. Delete it. It will be regenerated with details of current DFC client location.
0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 104 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management