0 Replies Latest reply on Jul 20, 2017 5:11 AM by andreasweber-1

    Need help to refactor RAR into separate deployment

    andreasweber-1

      Hello,

       

      I would appreciate any help with this issue:

       

      I have an application running on JBoss EAP 6.4.0 (ear deployment). This ear includes an ejb project (with a MessageDrivenBean) and a rar (which is the resource adapter for the MDB).

      There is also one API jar component (provides API to be used by MDB and RAR).

       

      So the ear looks like this:

      app.ear

      - ejb.jar (contains MDB)

      -- META-INF/jboss-ejb3.xml (defines which rar to use for MDB)

      - adapter.rar (contains ResourceAdapter)

      - api.jar (contains message listener interface

      /lib (all libraries requried by ejb.jar)

      /META-INF/application.xml (this defines ejb.jar, adapter.rar and api.jar das modules of the EAR)

       

      If I deploy this to JBoss EAP, everything works correct, and messages sent by rar to the MDB are processed.

       

      However, I like to separate the deployments:

      rar should be an independent deliverable, and the MDB inside ejb/ear is justed plugged in to one available rar (defined with property substitution in jboss-ejb3.xml)

       

      However I already spent hours and was not successful. The main problem is that I get the message JBAS014521: No message listener of type <interface in api.jar>  found in resource adapter adapter.rar

       

      Is there any example available where actually an MDB of an EAR project uses a resource adapter that was deployed indepdenent?

       

      Here is my attempt:

       

      New EAR file:

      app.ear

      - ejb.jar (contains MDB)

      -- META-INF/jboss-ejb3.xml (defines which rar to use for MDB)

      \lib\api.jar (contains message listener interface)

       

      RAR deployment:

      adapter.rar

      adapter.jar (jar file of RAR adapter

      api.jar (message listener interface, same as in EAR\lib)

      META-INF/ra.xml - define inbound resource adapter class

       

       

      If I deploy this, I get exception as mentioned above (JBAS014521). The adapter itself deploys fine, only the ear fails.

       

      Obviously there is some problem as JBoss does not "understand" that the interface in the ear file is actually the same interface as in the rar file (but of course those are binary the same files, since this artifact comes from a maven dependency).

       

       

      Thanks,

      Andreas