Could not initialize class com.documentum.fc.common.DfLogger

Options
gangadharak
edited March 23, 2022 in Documentum #1

Hi Team,


we are using 21.4 dfc along with spring boot, during IDF session creation it's throwing NoClassDefFoundError. when I create seperate java project and try to execute below code it's not throwing any exception.

spring project some jar conflicting with dfc.jar , is there any way to figure out which jars causing problem?.




  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);

  if (pass != null) {

   loginInfoObj.setPassword(pass);

  }

  loginInfoObj.setDomain(null);

  sMgr.setIdentity(docbase, loginInfoObj);



Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.documentum.fc.common.DfLogger


at com.documentum.fc.common.DfNewInterprocessLockImpl.release(DfNewInterprocessLockImpl.java:148)


at com.documentum.fc.common.DfNewInterprocessLock.release(DfNewInterprocessLock.java:28)


at com.documentum.fc.client.DfSimpleDbor.read(DfSimpleDbor.java:483)


at com.documentum.fc.client.DfSimpleDbor.setURL(DfSimpleDbor.java:133)


at com.documentum.fc.client.DfSimpleDbor.<init>(DfSimpleDbor.java:66)


at com.documentum.fc.client.DfClient$ClientImpl.<init>(DfClient.java:352)


at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:786)


at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:43)


at com.juliusbaer.itint.chn.documentmanagement.util.DocumentumSessionUtil.createSessionManager(DocumentumSessionUtil.java:78)


at com.juliusbaer.itint.chn.documentmanagement.util.DocumentumSessionUtil.main(DocumentumSessionUtil.java:145)

Comments

  • Did you patch log4j2? If you did, perhaps you forgot to update the META-INF/MANIFEST.MF file within dfc.jar?

  • Thank you for the reply

    No I didn't patch any log4j am using as is DFC jar. Also, as I mentioned when I place the dfc21.4.jar in spring project it's failing to create session. if i place same create session code in standalone project it's working fine.

  • I've used DFC and spring boot successfully before. In any case, I recommend that you move to DFC 22.1 since it comes with the latest log4j2 libraries (i.e. without the infamous Log4shell vulnerability). Patching DFC 21.4 is a pain in the neck.

  • S_S_Charan
    edited August 5, 2022 #5
    Options

    if you are using DFC 21.4, then update classpath to use java log4j-1.2-api-2.17.1.jar log4j-api-2.17.1.jar log4j-core-2.17.1.jar, this will resolve the issue (dfc.jar/META-INF/MANIFEST.MF refers to wrong versions of above jars)

  • Hi,

    I had the same problem with dfc 23.2 and spring boot. I resolved the problem adding log4j-jul and log4j-slf4j-impl. I also exclude from spring-boot-starter the artifact spring-boot-starter-logging.

  • Marco, Are you using Spring Boot/DFC with SSO?

    Many thanks

  • Hi JCHall,

    we use Microsoft Entra ID tokens to authenticate our custom spring boot app and then dfc login ticket to authenticate to documentum.

    MN