Importing files in Documentum using a standalone code not working
Hi all,
I am trying to create a standalone application where I can import files in documentum server. But I am getting the following error.Kindly help to rectify it.
public class LocalToDocumentum {
IDfSysObject sysObject = null;
static IDfSession idfSession = null;
static IDfSessionManager sessMgr = null;
public LocalToDocumentum(String user, String passwd, String docbase) throws Exception {
getDfSession(user, passwd, docbase);
}
public IDfSession getDfSession(String args1, String args2, String args3) throws Exception {
IDfLoginInfo login = new DfLoginInfo();
login.setUser(args1);
login.setPassword(args2);
IDfClient client = new DfClient();
sessMgr = client.newSessionManager();
sessMgr.setIdentity(args3, login);
idfSession = sessMgr.getSession(args3);
if ( idfSession != null )
System.out.println("Session created successfully");
return idfSession;
}
public void importDocument() throws Exception {
IDfSysObject sysObject = (IDfFolder) idfSession.getObjectByPath("documentum folder path");
System.out.println("Object ID " + sysObject.getObjectId());
IDfClientX clientx = new DfClientX();
IDfImportOperation importOper = clientx.getImportOperation();
importOper.setSession(idfSession);
if (importOper == null )
System.out.println("operation object is null");
importOper.setDestinationFolderId(sysObject.getObjectId());
importOper.setVersionLabels("imported using operation");
IDfImportNode node = (IDfImportNode) importOper.add("local file path");
node.setFormat("pdf");
boolean flag = importOper.execute();
displayError(importOper, flag);
}
public void displayError(IDfOperation operation, boolean flag) throws Exception {
if (!flag) {
IDfList errlist = operation.getErrors();
for (int i=0;i<errlist.getCount(); i++) {
IDfOperationError errOperation = (IDfOperationError) errlist.get(i);
System.out.println("Error MSG " + errOperation.getMessage());
}
}
}
public static void main(String[] args) throws Exception {
LocalToDocumentum object = new LocalToDocumentum("username","password","doc base");
try {
} finally {
sessMgr.release(idfSession);
}
}
The following is my dfc.properties file placed in "C:/Documentum/config folder
#dfc.docbroker.host[0]=
#dfc.globalregistry.repository=
#dfc.globalregistry.username=
#dfc.globalregistry.password=
#dfc.docbroker.host[0]=
#dfc.globalregistry.repository=
#dfc.globalregistry.username=
#dfc.globalregistry.password=
dfc.name = tstr500833.aaa.com
dfc.data.dir=C:/Documentum/config/
dfc.globalregistry.password=****
dfc.globalregistry.repository=doc_base
dfc.globalregistry.username=dm_bof_registry
dfc.session.secure_connect_default=try_native_first
dfc.tokenstorage.dir=/log/logmon/documentum/doc_shared/apptoken
dfc.tokenstorage.enable=false
dfc.docbroker.host[0]=tstr500833.aaa.com
dfc.docbroker.port[0]=1489
dfc.docbroker.host[1]=tstr500834.aaa.com
dfc.docbroker.port[1]=1489
dfc.docbroker.host[2]=tstr500833.aaa.com
dfc.docbroker.port[2]=1501
dfc.docbroker.host[3]=tstr500834.aaa.com
dfc.docbroker.port[3]=1501
#dfc.crypto.repository=doc_base
Comments
-
The following is the error I am getting.
0 [main] ERROR com.documentum.fc.common.impl.logging.LoggingConfigurator - Problem locating log4j configuration
0 [main] WARN com.documentum.fc.common.impl.logging.LoggingConfigurator - Using default log4j configuration
85 [main] ERROR com.documentum.fc.client.security.impl.IdentityManager - [DFC_SECURITY_IDENTITY_INIT] no identity initialization or incomplete identity initialization
java.lang.NullPointerException
at com.documentum.fc.common.impl.MessageHelper.isPreformatted(MessageHelper.java:130)
at com.documentum.fc.common.impl.MessageHelper.setMessage(MessageHelper.java:102)
at com.documentum.fc.common.impl.MessageHelper.setMessage(MessageHelper.java:96)
at com.documentum.fc.common.impl.MessageHelper.<init>(MessageHelper.java:29)
at com.documentum.fc.common.DfRuntimeException.doCommonConstruction(DfRuntimeException.java:112)
at com.documentum.fc.common.DfRuntimeException.<init>(DfRuntimeException.java:100)
at com.documentum.fc.common.DfRuntimeException.<init>(DfRuntimeException.java:88)
at com.documentum.fc.common.DfRuntimeException.<init>(DfRuntimeException.java:78)
at com.documentum.fc.common.DfCriticalException.<init>(DfCriticalException.java:18)
at com.documentum.fc.client.security.internal.CreateIdentityCredential$MultiFormatPKIKeyPair.<init>(CreateIdentityCredential.java:732)
at com.documentum.fc.client.security.internal.CreateIdentityCredential.<init>(CreateIdentityCredential.java:98)
at com.documentum.fc.client.security.impl.InitializeKeystoreForDfc.<init>(InitializeKeystoreForDfc.java:45)
at com.documentum.fc.client.security.internal.KeystoreMgr.initForDfcWithDefaultPolicy(KeystoreMgr.java:70)
at com.documentum.fc.client.security.impl.IdentityManager.initFromKeystore(IdentityManager.java:170)
at com.documentum.fc.client.security.impl.IdentityManager.<init>(IdentityManager.java:40)
at com.documentum.fc.impl.RuntimeContext.<init>(RuntimeContext.java:52)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:181)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:703)
at DB.LocalToDocumentum.getDfSession(LocalToDocumentum.java:67)
at DB.LocalToDocumentum.<init>(LocalToDocumentum.java:61)
at DB.LocalToDocumentum.main(LocalToDocumentum.java:104)
453 [main] ERROR com.documentum.fc.client.security.impl.IdentityManager - [DFC_SECURITY_IDENTITY_CREATION] failure on creation of identity: 'bad bundle'
DfException:: THREAD: main; MSG: [DFC_SECURITY_IDENTITY_BUNDLE_FAIL] could not create identity bundle because identity initialization failed; ERRORCODE: ff; NEXT: null
at com.documentum.fc.client.security.impl.IdentityManager.createIdentityBundle(IdentityManager.java:219)
at com.documentum.fc.client.security.impl.IdentityManager.getIdentityBundle(IdentityManager.java:52)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.authenticate(DocbaseConnection.java:390)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.open(DocbaseConnection.java:118)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:87)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:54)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionFactory.newDocbaseConnection(DocbaseConnectionFactory.java:26)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionManager.getDocbaseConnection(DocbaseConnectionManager.java:74)
at com.documentum.fc.client.impl.session.SessionFactory.newSession(SessionFactory.java:29)
at com.documentum.fc.client.impl.session.PrincipalAwareSessionFactory.newSession(PrincipalAwareSessionFactory.java:35)
at com.documentum.fc.client.impl.session.PooledSessionFactory.newSession(PooledSessionFactory.java:47)
at com.documentum.fc.client.impl.session.SessionManager.getSessionFromFactory(SessionManager.java:111)
at com.documentum.fc.client.impl.session.SessionManager.newSession(SessionManager.java:64)
at com.documentum.fc.client.impl.session.SessionManager.getSession(SessionManager.java:168)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.connect(ModuleManager.java:358)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.init(ModuleManager.java:313)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.getInstance(ModuleManager.java:36)
at com.documentum.fc.client.security.impl.DfcIdentityPublisher.<init>(DfcIdentityPublisher.java:44)
at com.documentum.fc.client.security.internal.RegistrationMgr.register(RegistrationMgr.java:34)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:191)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:703)
at DB.LocalToDocumentum.getDfSession(LocalToDocumentum.java:67)
at DB.LocalToDocumentum.<init>(LocalToDocumentum.java:61)
at DB.LocalToDocumentum.main(LocalToDocumentum.java:104)
539 [main] WARN com.documentum.fc.client.impl.bof.classmgmt.ModuleManager - [DFC_BOF_COULDNT_CONNECT_TO_REGISTRY] Unable to connect to module registry, docbase name benefits_tst username dm_bof_registry.
DfAuthenticationException:: THREAD: main; MSG: [DM_SESSION_E_AUTH_FAIL]error: "Authentication failed for user dm_bof_registry with docbase benefits_tst."; ERRORCODE: 100; NEXT: null
at com.documentum.fc.client.impl.docbase.DocbaseExceptionMapper.newException(DocbaseExceptionMapper.java:52)
at com.documentum.fc.client.impl.connection.docbase.MessageEntry.getException(MessageEntry.java:39)
at com.documentum.fc.client.impl.connection.docbase.DocbaseMessageManager.getException(DocbaseMessageManager.java:137)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.checkForMessages(NetwiseDocbaseRpcClient.java:305)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForObject(NetwiseDocbaseRpcClient.java:648)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$8.evaluate(DocbaseConnection.java:1239)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1007)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForObject(DocbaseConnection.java:1231)
at com.documentum.fc.client.impl.docbase.DocbaseApi.authenticateUser(DocbaseApi.java:1700)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.authenticate(DocbaseConnection.java:404)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.open(DocbaseConnection.java:118)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:87)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:54)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionFactory.newDocbaseConnection(DocbaseConnectionFactory.java:26)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionManager.getDocbaseConnection(DocbaseConnectionManager.java:74)
at com.documentum.fc.client.impl.session.SessionFactory.newSession(SessionFactory.java:29)
at com.documentum.fc.client.impl.session.PrincipalAwareSessionFactory.newSession(PrincipalAwareSessionFactory.java:35)
at com.documentum.fc.client.impl.session.PooledSessionFactory.newSession(PooledSessionFactory.java:47)
at com.documentum.fc.client.impl.session.SessionManager.getSessionFromFactory(SessionManager.java:111)
at com.documentum.fc.client.impl.session.SessionManager.newSession(SessionManager.java:64)
at com.documentum.fc.client.impl.session.SessionManager.getSession(SessionManager.java:168)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.connect(ModuleManager.java:358)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.init(ModuleManager.java:313)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.getInstance(ModuleManager.java:36)
at com.documentum.fc.client.security.impl.DfcIdentityPublisher.<init>(DfcIdentityPublisher.java:44)
at com.documentum.fc.client.security.internal.RegistrationMgr.register(RegistrationMgr.java:34)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:191)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:703)
at DB.LocalToDocumentum.getDfSession(LocalToDocumentum.java:67)
at DB.LocalToDocumentum.<init>(LocalToDocumentum.java:61)
at DB.LocalToDocumentum.main(LocalToDocumentum.java:104)
548 [main] WARN com.documentum.fc.client.security.internal.RegistrationMgr - [DFC_SECURITY_GR_PUBLICATION_FAILED] Publication of DFC instance with global registry failed
DfException:: THREAD: main; MSG: [DFC_BOF_GLOBAL_REGISTRY_UNAVAILABLE] Unable to connect to the global registry no session; ERRORCODE: ff; NEXT: null
at com.documentum.fc.client.security.impl.DfcIdentityPublisher.<init>(DfcIdentityPublisher.java:55)
at com.documentum.fc.client.security.internal.RegistrationMgr.register(RegistrationMgr.java:34)
at com.documentum.fc.impl.RuntimeContext.<clinit>(RuntimeContext.java:191)
at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:703)
at DB.LocalToDocumentum.getDfSession(LocalToDocumentum.java:67)
at DB.LocalToDocumentum.<init>(LocalToDocumentum.java:61)
at DB.LocalToDocumentum.main(LocalToDocumentum.java:104)
676 [main] ERROR com.documentum.fc.client.security.impl.IdentityManager - [DFC_SECURITY_IDENTITY_CREATION] failure on creation of identity: 'bad bundle'
DfException:: THREAD: main; MSG: [DFC_SECURITY_IDENTITY_BUNDLE_FAIL] could not create identity bundle because identity initialization failed; ERRORCODE: ff; NEXT: null
at com.documentum.fc.client.security.impl.IdentityManager.createIdentityBundle(IdentityManager.java:219)
at com.documentum.fc.client.security.impl.IdentityManager.getIdentityBundle(IdentityManager.java:52)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.authenticate(DocbaseConnection.java:390)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.open(DocbaseConnection.java:118)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:87)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:54)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionFactory.newDocbaseConnection(DocbaseConnectionFactory.java:26)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnectionManager.getDocbaseConnection(DocbaseConnectionManager.java:74)
at com.documentum.fc.client.impl.session.SessionFactory.newSession(SessionFactory.java:29)
at com.documentum.fc.client.impl.session.PrincipalAwareSessionFactory.newSession(PrincipalAwareSessionFactory.java:35)
at com.documentum.fc.client.impl.session.PooledSessionFactory.newSession(PooledSessionFactory.java:47)
at com.documentum.fc.client.impl.session.SessionManager.getSessionFromFactory(SessionManager.java:111)
at com.documentum.fc.client.impl.session.SessionManager.newSession(SessionManager.java:64)
at com.documentum.fc.client.impl.session.SessionManager.getSession(SessionManager.java:168)
at DB.LocalToDocumentum.getDfSession(LocalToDocumentum.java:70)
at DB.LocalToDocumentum.<init>(LocalToDocumentum.java:61)
at DB.LocalToDocumentum.main(LocalToDocumentum.java:104)
Session created successfully
0 -
the log4j error has nothing to do with that. that's just a message stating that it can't find log4j.properties in the classpath.
why are you mixing windows and unix paths in dfc.properties?
dfc.data.dir=C:/Documentum/config/
dfc.tokenstorage.dir=/log/logmon/documentum/doc_shared/apptoken0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 151 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories