1 Reply Latest reply on Nov 4, 2013 5:34 AM by jaikiran

    jBoss EAP6.1 EAR not able to access classes from RAR

    sjunejo

      I am working with jBoss EAP 6.1 and deployed my Resource Adapter by simply putting it under deployments. Tested by simply deployed my .war file with jboss-deployment-structure under WEB-INF to make it dependent on the resource adapter. Everything works OK as I am able to access the Connection classes (so far so good).

       

      Now I want to do the same for my EAR deployment where I have two EJB's which needs the same classes (Connection classes) from this RAR. I have added following jboss-deployment-structure.xml under .ear/META-INF;

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
        <!-- 
        jBoss 7 specific file to add dependency on tocfT24ra-ra.rar 
        so that we can access the RA classes.
        Note: This will save us efforts to deploy Resource Adapter
        as <global-module>
        -->
        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
        <sub-deployment name="tocfOFSmessage-ejb.jar">
        <dependencies>
        <module name="deployment.tocfT24ra-ra.rar" />
        </dependencies>
        </sub-deployment>
        <sub-deployment name="delivery-ejb.jar">
        <dependencies>
        <module name="deployment.tocfT24ra-ra.rar" />
        </dependencies>
        </sub-deployment>
      </jboss-deployment-structure>
      

       

      But I am getting following exception when my EJB tries to access a connection from my resource adapter pool;

       

      23:29:02,806 ERROR [org.jboss.as.ejb3.invocation] (Thread-1 (HornetQ-client-global-threads-1755072257)) JBAS014134: EJB Invocation failed on component
       OFSMessageMDB for method public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message): javax.ejb.EJBException: java.lang.RuntimeExcept
      ion: java.lang.NoClassDefFoundError: com/temenos/tocf/t24ra/T24ConnectionFactory
              at org.jboss.as.ejb3.tx.BMTInterceptor.handleException(BMTInterceptor.java:80) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at org.jboss.as.ejb3.tx.EjbBMTInterceptor.checkStatelessDone(EjbBMTInterceptor.java:92) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-re
      dhat-8]
              at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:107) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-red
      hat-8]
              at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:56) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
      
      
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-
      2]
              at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Fina
      

       

      Not sure if I have missed anything?

       

      Note: I have looked at this thread for reference How do I make RAR classes visible to separate EAR modules? JBoss 7.1.1.Final, IronJacamar 1.0.16.Final, JDK 6 but in my case I do not have any jboss-deployment-structure.xml inside .rar, is it mandatory?

       

      Thanks