Forum Discussion

FICO's avatar
FICO
Community Manager
5 years ago

NoClassDefFoundError when loading NdStatelessServer class

After upgrading my application from blaze 7.4 to blaze 7.7 I'm getting this error when trying to deploy my java weblogic application:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.blazesoft.server.deploy.NdStatelessServer
        at com.blazesoft.server.deploy.NdStatelessServerDeploymentBase.createServer(:49)
        at com.blazesoft.server.deploy.NdServerDeploymentBase.initialize(:377)
        at com.blazesoft.server.deploy.ejb.session.NdStatelessEjbServer.bANUJIKE(:228)
        at com.blazesoft.server.deploy.ejb.session.NdStatelessEjbServerBeanBase.create(:55)
        at com.blazesoft.server.deploy.ejb.session.NdStatelessEjbServerBean.ejbCreate(:56)

This issue seems similar to this post which is leading me to believe that I am missing a jar on my buildpath. AdvCommon, Advisor, AdvisorSvr, and InnovatorRT are all used in my application and are on the buildpath,. Are there any other jars/dependencies I may be missing? Also, is there a way to get a more detailed exception in blaze like a debug mode that would give me more information on the NoClassDefFoundError

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    I ran into this (or similar) issue before, and the cause turned out to be a missing dependency of log4j2. Looks like the older 7.x versions were using log4j v1.x, and as AdvisorSvr and friends do not list their dependencies in an embedded pom.xml, there's no way to get a warning during maven build.

    You can lookup the dependencies needed in the Advisor77/bin/setenv.* scripts, and there's a good explanation of what is needed and when in the "Adding Jar Files" section of DevelopingRuleMaintenanceApplications.pdf, page 442.

  • FICO's avatar
    FICO
    Community Manager

    This specific class is located inside the AdvisorSrv.jar file, located at C:\Blaze\Advisor77\lib directory. If you run a "find" command script, like the example below, you'll find the class there:

    C:\Blaze\Advisor77\lib>for /R %G in (*.jar) do @jar -tvf "%G" | find "NdStatelessServer" > NUL && echo %G
    C:\Blaze\Advisor77\lib\AdvisorSvr.jar

    Screen Shot 2021-08-02 at 2.22.17 PM

    ​So, please, check if you are adding this jar inside your setenv.bat file, and that you are executing the file before deploying.

  • FICO's avatar
    FICO
    Community Manager

    Thanks for the replies, as Gyorgy Camaszotisz suggested the issue was actually that my log4j jars were outdated, Blaze upgraded the jars from 1.x to 2.x sometime during the 7.4 - 7.7 and I needed to upgrade the jars i used.