documentum会话获取错误

时间:2014-08-07 07:59:08

标签: java documentum dfc

    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!!!

我已经添加了配置文件,log4j文件和添加的jar文件 我已经完成了所有事情,但仍然无法获得输出

1 个答案:

答案 0 :(得分:3)

您是否仍然收到相同的错误消息?如果是,则是因为您的全局注册表配置已损坏:

"Authentication failed for user dm_bof_registry with docbase docbasename."; ERRORCODE: 100; NEXT: null

检查应该在CLASSPATH中的dfc.properties并查找以下键:

dfc.globalregistry.password=
dfc.globalregistry.repository=
dfc.globalregistry.username=dm_bof_registry

确保用户,密码和存储库(即文档库名称)正确无误 - 您可以尝试使用任何Documentum客户端(例如Documentum Administrator或Webtop)使用这些凭据登录以验证它们。

根据您的Content Server设置,您还可以尝试注释掉这三行。