0 Replies Latest reply on Feb 3, 2016 2:02 PM by Vladyslav Baidak

    JAR deployment throws ClassNotFoundException

    Vladyslav Baidak Newbie

      I have 3 deployments:

      • ejb.jar - contains EJBs, which I use in other deployments, e.g. InventoryRemote
      • items.war - jsf deployment, which uses InventoryRemote from ejb.jar module
      • jms-mdb.jar - contains MDB, which also uses InventoryRemote

       

      Firstly I successfully deploy ejb.jar, then I deploy items.war (items.war does not contain ejb.jar as library within the jar package). JSF works fine. Then I try to deploy jms-mdb.jar and get the stacktrace:

       

      2016-02-03 20:52:24,708 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."jms-mdb.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jms-mdb.jar".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "jms-mdb.jar"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.software.shell.javaee.jms.mdb.item.ItemMDB with ClassLoader ModuleClassLoader for Module "deployment.jms-mdb.jar:main" from Service Module Loader

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)

          at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)

          ... 5 more

      Caused by: java.lang.NoClassDefFoundError: Lcom/software/shell/javaee/ejb/inventory/InventoryRemote;

          at java.lang.Class.getDeclaredFields0(Native Method)

          at java.lang.Class.privateGetDeclaredFields(Class.java:2583)

          at java.lang.Class.getDeclaredFields(Class.java:1916)

          at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)

          ... 10 more

      Caused by: java.lang.ClassNotFoundException: com.software.shell.javaee.ejb.inventory.InventoryRemote from [Module "deployment.jms-mdb.jar:main" from Service Module Loader]

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

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

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

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

          ... 15 more

       

      When I pack jms-mdb.jar with the ejb.jar library everything works fine.

       

      So the question is why items.war works fine without packing the dependent library ejb.jar, but in case of jms-mdb.jar it doesn't work

       

      Thanks