JBoss Appserver with APM Java Agent installed, failed to start up due to NoClassDefFound error.

Document ID : KB000031087
Last Modified Date : 14/02/2018
Show Technical Document Details

 Problem:

  After installing and configuring an Introscope JBoss agent on a JBoss Application Server, JBOSS AS and Introscope Agent will experience a forced shut down shortly after starting up, due to the following error message or similar errors looking for Agent classes:

  INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final-redhat-1
  Exception in thread "main" java.lang.NoClassDefFoundError: com/wily/introscope/agent/AgentShim
    at org.jboss.as.process.Main.main(Main.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jboss.modules.Module.run(Module.java:312)
    at org.jboss.modules.Main.main(Main.java:460)
    Caused by: java.lang.ClassNotFoundException: com.wily.introscope.agent.AgentShim from [Module "org.jboss.as.process-controller:main" from local module loader     @1c0b5c67 (finder: local module finder @2ddf7c9 3 (roots: /manh/3rdparty/swtools/jboss-eap-6.3/modules,/manh/3rdparty/swtools/jboss-eap-6.3/modules/system/layers/base))] 

    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(Concur rentClassLoader.java:389)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)

 

 

 Cause:

  This error indicates that the JBoss AS could not find the AgentShim file which is included in the Agent.jar.

 

 Resolution:

  To resolve the error, the existing Java package property(if any) needs to be modified within the JBoss start-up sequence to include wily packages as follows:

  • Djboss.modules.system.pkgs=org.jboss.byteman,com.wily,com.wily.*

  In a JBoss Standalone deployment:

  Edit the "-Djboss.modules.system.pkgs" property in the file standalone.conf.bat (Windows) or standalone.conf (Unix/Linux) to add in the wily packages.

  For example:

  JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,com.wily,com.wily.*

  In a JBoss Domain deployment:

  Edit the "-Djboss.modules.system.pkgs" property in the file domain.conf.bat (Windows) or domain.conf (Unix/Linux) and add the same value as above.

 

Additional Information:  

  If jboss.modules.system.pkgs property is already defined, then you need to ensure that com.wily,com.wily.* are appended to same. Otherwise if there are multiple

  definitions then value gets overwritten by last encountered and problem will persist.