1 Reply Latest reply on Jul 24, 2015 10:35 AM by venik

    Wildfly 9.0.0 - java.lang.NoClassDefFoundError error when starting with javaagent

    venik

      I am running WildFly 9.0.0 in standalone mode and try to start it with a javaagent. The agent is set in the standalone.bat file just above rem Setup JBoss specific properties

       

      The agent inserts method calls to org/test/Logger/Log method which is declared inside the agent itself.

      When I start WildFly the agent gets attached and the org/test/Logger/Log method is called multiple times.


      But then it crashes with this exception:

       

      Exception in thread "main" java.lang.NoClassDefFoundError: org/test/Logger/Log
              at org.jboss.logmanager.LogManager.<clinit>(LogManager.java)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at java.lang.Class.newInstance0(Unknown Source)
              at java.lang.Class.newInstance(Unknown Source)
              at java.util.logging.LogManager$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.util.logging.LogManager.<clinit>(Unknown Source)
              at org.jboss.modules.Main.main(Main.java:470)

      Caused by: java.lang.ClassNotFoundException: org.tes.Logger from [Module "org.jboss.logmanager:main" from local module loader @a45f686 (finder: local module finder @773bdcae (roots: E:\Java\wildfly-9.0.0.Final\wildfly-9.0.0.Final\modules,E:\Java\wildfly-9.0.0.Final\wildfly-9.0.0.Final\modules\system\layers\base))]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

              ... 11 more

      I would appreciate any help in determining why this might be happening?

       

      Thanks!