1 Reply Latest reply on Apr 14, 2016 8:15 AM by Erwan Lacoste

    EAP 6 dependency from a WAR to an adjacent EJB module

    Erwan Lacoste Newbie

      I am migrating some old dirty project to EAP6, and I'm struggling with classpath issues.

       

      My situation is quite classical, as I have the following EAR structure:

      app.ear

      /lib

      *.jar

      my.ejb1.jar

      my.ejb2.jar

      my.war1.war

      my.war.2.war

       

      I need to have my.war1.war and my.war2.war have access to classes from my.ejb1.jar. I isolated the subdeployments in standalone.xml (<ear-subdeployments-isolated>true</ear-subdeployments-isolated>) as I need to deploy the 2 wars independently.

       

      I tried different solutions (in the WAR archive):

      adding "my.ejb1.jar" in META-INF/MANIFEST.MF Class-Path section

      adding "deployment.app.ear.my.ejb1.jar" in META-INF/MANIFEST.MF Dependencies section

      adding "<module name="deployment.bis.ear.jkt-appservice.jar"/>" in jboss-deploment-structure.xml section deployment/dependencies

       

      I always get the following:

      11:48:26,421 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."bis.ear"."bis.apps.bis.price-web-3.99.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."bis.ear"."bis.apps.bis.price-web-3.99.0-SNAPSHOT.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment "bis.apps.bis.price-web-3.99.0-SNAPSHOT.war" of deployment "bis.ear"

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_65]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_65]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]

      Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class be.project.jkt.common.filter.JkitFilter with ClassLoader ModuleClassLoader for Module "deployment.bis.ear:main" from Service Module Loader

        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

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

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

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        ... 5 more

      Caused by: java.lang.NoClassDefFoundError: be/project/jkt/profile/service/ProfileService

        at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.8.0_65]

        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) [rt.jar:1.8.0_65]

        at java.lang.Class.getDeclaredMethods(Class.java:1975) [rt.jar:1.8.0_65]

        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        ... 10 more

       

      What am I missing to get the WARs deploy correctly with "my.ejb1.jar" being part of their classpath?