2 Replies Latest reply on Aug 6, 2010 1:53 AM by grta12

    RAR inside EAR, JBoss 5.1.0

    grta12

      Hello!

       

      I have problems with deployment of RAR inside EAR,

      MDB can't start because EJB is deployed before resource adapter.

       

      Could you help me, is any workaround exists to solve this problem?

       

      Deployment "jboss.j2ee:ear=TaisCore.ear,jar=TestEJB.jar,name=TestMDB,service=EJB3" is in error due to the following reason(s): javax.management.InstanceNotFoundException: jboss.jca:service=RARDeployment,name='Test.ear#Test-ra.rar' is not registered.

       

       

      Part of MDB code:

       

      @MessageDriven(
              name="TestMDB",
              messageListenerInterface=FSListener.class)
      @ResourceAdapter("Test.ear#Test-ra.rar")       
      public class TestListenerMDB implements MessageDrivenBean, FSListener {

      ...

      }

       

       

      Ear's META-INF/jboss.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss>
         <enterprise-beans>
            <message-driven>
               <ejb-name>TestMDB</ejb-name>
               <resource-adapter-name>Test.ear#Test-ra.rar</resource-adapter-name>
            </message-driven>
         </enterprise-beans>
      </jboss>

       

       

      Resource adapter deploys perfectly outside ear. I want to deploy it inside EAR because of a shared FSListener interface, for not creating a shared jar with this interface for RAR and EAR and not to worry that RAR would be deployed after EAR by some reasons.

       

      Could you help me with this problem?

       

      Thank you very much,

      Andrew.

        • 1. Re: RAR inside EAR, JBoss 5.1.0
          wolfgangknauf

          Hi,

           

          maybe it helps to add a "@Depends" annotation to your MDB:

           

           

          @MessageDriven(
                  name="TestMDB",
                  messageListenerInterface=FSListener.class)
          @ResourceAdapter("Test.ear#Test-ra.rar")      

          @Depends (value="jboss.jca:service=RARDeployment,name='Test.ear#Test-ra.rar'")
          public class TestListenerMDB implements MessageDrivenBean, FSListener {

          ...

          }

           

          this should wait with MDB deployment until the dependent service was started. I don't know whether the name is correct, you should check it in JMX console. I just picked thje name from your error message.

           

           

          Hope this helps

           

          Wolfgang

          • 2. Re: RAR inside EAR, JBoss 5.1.0
            grta12

            Wolfgang!

            Thank you very much!

             

            I tried @Depends annotation before, but I wrote name='Test.ear#Test-ra.rar' without apostrophes.

             

            It works now perfectly!

             

            Thank you!!!