3 Replies Latest reply on Aug 7, 2013 6:32 AM by Raghavan Ramanujam

    JCA RAR included impl jar dependency in a war won't work

    Newbie

      I have resource adapter (ironjackamar) that is externally deployed (not with an ear).  We have war that access the connection object using the rar and the connection type class is located in resource adapter impl jar which is bundled as part of the rar. I tried several ways but none of them seems to be working. The only way it works, if I include the war with in the ear, unfortunately we don't want to create ear's unless it required.

       

      My question is do I need to have a dummy ear make this dependecy work? Any idea why the war alone depenendy doesn't work.

       

      Approaches that didn't work with war deployment.

      -------------------------------------------------------------------------

      Caused by: java.lang.NoClassDefFoundError: com/cgi/cml/common/momapi/connector/ra/outbound/MomapiConnection

       

      Approach1 : war: jboss-deployment-structure.xml

      -----------------------------------------------------------------------

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

         <module name="deployment.momentum-rest-web-1.0.war" >

          <dependencies>

            <module name="deployment.momentum-momapi-ra-1.0.rar"/>

          </dependencies>

        </module>

      </jboss-deployment-structure>

       

      Approach2 : war: jboss-deployment-structure.xml

      -----------------------------------------------------------------------

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

         <module name="deployment.momentum-rest-web-1.0.war.cml-momapi-rest-core-1.0.jar" >

          <dependencies>

            <module name="deployment.momentum-momapi-ra-1.0.rar"/>

          </dependencies>

        </module>

      </jboss-deployment-structure>

       

      Approach3 : war: jboss-deployment-structure.xml

      -----------------------------------------------------------------------

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

         <module name="deployment.momentum-rest-web-1.0.war.cml-momapi-rest-core-1.0.jar" >

          <dependencies>

            <module name="deployment.momentum-momapi-ra-1.0.rar.cml-momapi-ra-impl-1.0.jar"/>

          </dependencies>

        </module>

      </jboss-deployment-structure>

       

       

      The only way it works, provided if I define a dummy ear and include the following jboss-deployment-structure.xml

       

      Working Approach : EAR: jboss-deployment-structure.xml

      -----------------------------------------------------------------------

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

        <sub-deployment name="momentum-rest-web-1.0.war">

          <dependencies>

            <module name="deployment.momentum-momapi-ra-1.0.rar" />

          </dependencies>

        </sub-deployment>

        </jboss-deployment-structure>

       

       

      Thanks

      Sri

        • 1. Re: JCA RAR included impl jar dependency in a war won't work
          Newbie

          Never mind, through some trail and error I got the answer. The war should contains the following jboss-deployment-structure.xml in war/WEB-INF

           

          <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

                    <deployment>

                              <dependencies>

                                        <module name="deployment.momentum-momapi-ra-1.0.rar" />

                              </dependencies>

                    </deployment>

          </jboss-deployment-structure>

          • 2. Re: JCA RAR included impl jar dependency in a war won't work
            Raghavan Ramanujam Newbie

            I have  a need to bundle the reource adapter as part of my war. I am not able to get this working. Any Idea on what should I do. If I understand your answer correctly the resource adapter is deployed as a separate one. In couple of documentations it is said to put as part of WEB-INF/lib and it will take but when I did that I got an error as

             

             

            12:57:11,844 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."TestAppServletProject.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."TestAppServletProject.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "TestAppServletProject.war"

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

            Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class net.**.**.ResourceAdapterTestServlet with ClassLoader ModuleClassLoader for Module "deployment.TestAppServletProject.war:main" from Service Module Loader

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

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

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

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

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

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

                      ... 5 more

            Caused by: java.lang.NoClassDefFoundError: Lnet/**/**/framework/workmanager/WMConnectionFactory;

                      at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_17]

                      at java.lang.Class.privateGetDeclaredFields(Class.java:2317) [rt.jar:1.7.0_17]

                      at java.lang.Class.getDeclaredFields(Class.java:1762) [rt.jar:1.7.0_17]

                      at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]

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

                      ... 10 more

            Caused by: java.lang.ClassNotFoundException: net.**.**.framework.workmanager.WMConnectionFactory from [Module "deployment.TestAppServletProject.war:main" from Service Module Loader]

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

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

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

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

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

                      ... 15 more

            • 3. Re: JCA RAR included impl jar dependency in a war won't work
              Raghavan Ramanujam Newbie

              The JCA Connectors are not getting bundled in a war. They need to get bundled as part of ear only. After various tries we got settled to ear. You can just use a simple / dummy ear that would contain the connector and the required war that wants to access this Connector