import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.IDfLoginInfo;;
public class Samplesession {
IDfSysObject sysObject = null;
IDfSessionManager sessMgr = null;
public Samplesession()
{
System.out.println("SessionEx constructor called!!!");
}
public IDfSessionManager getSessionManager(String args1, String args2, String args3) throws Exception
{
IDfClientX clientx= new DfClientX();
IDfClient client=clientx.getLocalClient();
IDfSessionManager sMgr = client.newSessionManager();
IDfLoginInfo login = clientx.getLoginInfo();
login.setUser(args1);
login.setPassword(args2);
sMgr.setIdentity(args3, login);
return sMgr;
}
public static void main(String[] args) {
{
String user="",password="",docbase="";
IDfSessionManager sMgr = null;
IDfSession session = null;
try
{
Samplesession object = new Samplesession();
sMgr=object.getSessionManager(user,password,docbase);
session=sMgr.getSession(docbase);
if (session != null)
System.out.println("Session created Successfully!!!"+session);
else
System.out.println("Please check the login information again!!!");
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
if (session != null)
{
sMgr.release(session);
System.out.println("Session released Successfully!!!");
}
}
}
}
}
}
This is uder the dfc classes
And the errors are below!!!!!!!!
SessionEx constructor called!!!
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
10374 [main] WARN com.documentum.fc.client.impl.bof.classmgmt.ModuleManager - [DFC_BOF_COULDNT_CONNECT_TO_REGISTRY] Unable to connect to module registry, docbase name docbasename username dm_bof_registry.
DfAuthenticationException:: THREAD: main; MSG: [DM_SESSION_E_AUTH_FAIL]error: "Authentication failed for user dm_bof_registry with docbase docbasename."; 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:310)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForObject(NetwiseDocbaseRpcClient.java:653)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$8.evaluate(DocbaseConnection.java:1293)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1056)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForObject(DocbaseConnection.java:1285)
at com.documentum.fc.client.impl.docbase.DocbaseApi.authenticateUser(DocbaseApi.java:1703)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.authenticate(DocbaseConnection.java:417)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.open(DocbaseConnection.java:128)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:97)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.<init>(DocbaseConnection.java:60)
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:85)
at com.documentum.fc.client.impl.session.SessionFactory.newSession(SessionFactory.java:29)
at com.documentum.fc.client.impl.session.PrincipalAwareSessionFactory.newSession(PrincipalAwareSessionFactory.java:42)
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:353)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.init(ModuleManager.java:308)
at com.documentum.fc.client.impl.bof.classmgmt.ModuleManager.getInstance(ModuleManager.java:35)
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:734)
at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:43)
at qbe4lpg.read.sample.Samplesession.getSessionManager(Samplesession.java:22)
at qbe4lpg.read.sample.Samplesession.main(Samplesession.java:41)
10547 [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:734)
at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:43)
at qbe4lpg.read.sample.Samplesession.getSessionManager(Samplesession.java:22)
at qbe4lpg.read.sample.Samplesession.main(Samplesession.java:41)
Session created Successfully!!!com.documentum.fc.client.impl.session.StrongSessionHandle@18f6559
Session released Successfully!!!
I allready added config file, log4j file and added jar files also I have done every thing but still not able to getting output
Are you still getting the same error message? If yes then it is because your Global Registry configuration is broken:
"Authentication failed for user dm_bof_registry with docbase docbasename."; ERRORCODE: 100; NEXT: null
Check dfc.properties that should be in your CLASSPATH and look for following keys:
dfc.globalregistry.password=
dfc.globalregistry.repository=
dfc.globalregistry.username=dm_bof_registry
Make sure that the user, password and the repository (that is the docbase name) is correct - you can try logging in using those credentials using any Documentum client, e.g Documentum Administrator or Webtop to verify them.
Depending on your Content Server setup you can also try to comment out those three lines.