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
IDfSessionManager createSessionManager(String docbase, String user, String pass)
throws Exception {
//create Client objects
IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
//create a Session Manager object
IDfSessionManager sMgr = client.newSessionManager();
//create an IDfLoginInfo object named loginInfoObj
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser(user);
loginInfoObj.setPassword(pass);
loginInfoObj.setDomain(null);
//bind the Session Manager to the login info
sMgr.setIdentity(docbase, loginInfoObj);
//could also set identity for more than one Docbases:
// sMgr.setIdentity( strDocbase2, loginInfoObj );
//use the following to use the same loginInfObj for all Docbases (DFC 5.2 or later)
// sMgr.setIdentity( * , loginInfoObj );
return sMgr;
}
I have included the dfc.jar in the class path. I run the program using the main()
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
IDfSessionManager dfSessionManager = createSessionManager("url","username","password");
System.out.println(dfSessionManager);
}
I get the below exception:
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.