4 Replies Latest reply on Feb 1, 2005 8:28 PM by danl_thompson

    Can MBeans be packaged in an EAR?

    danl_thompson

      I have a nice little MBean, which, if I deploy it separately in a SAR (outside of my EAR) it works and I can get to it via the JMX console.

      But we need it to be packaged as part of the EAR.

      Following the 3.2.3 manual I have the following:
      my.ear
      +- my.jar (archive) [EJB jar]
      | +- META-INF/ejb-jar.xml
      | +- ...my EJB classes
      +- my.sar (archive) [MBean sar]
      | +- META-INF/jboss-service.xml
      | +- ... MyMBean classes
      +- META-INF/application.xml (includes module defn for my.jar)

      And during deployment, I see the EJBs themselves are deployed properly, but then I no longer find any reference to the MBean in JMX-Console.

      what am I missing?

        • 1. Re: Can MBeans be packaged in an EAR?
          starksm64

          EARs only deploy what has been declared as deployable content. A sar must be declared using the ear META-INF/jboss-app.xml descriptor:

          <jboss-app>
           <module>
           <service>cts-v2cmp.sar</service>
           </module>
          </jboss-app>
          



          • 2. Re: Can MBeans be packaged in an EAR?
            danl_thompson

            It works just like magic.

            You know Scott, after working with JBoss for 18 months, my biggest problem is still understanding how to find answers like this. And spending days doing so. (More often just spending days understanding which questions to ask)

            The 3.2.3 manual leaves one with the following tantalizing but cryptic mention of jboss-app.xml in chapter 2 (and no where else):

            >>To enable an EAR specific loader repository, you need to create a
            >>META-INF/jboss-app.xml

            So I certainly would not have figured it out based on that alone. Thanks again for your help. I would still be spinning my wheels. Hope to see you in Atlanta.

            dt

            • 3. Re: Can MBeans be packaged in an EAR?
              starksm64

              The answer to every question exist in the testsuite module of the source download.

              • 4. Re: Can MBeans be packaged in an EAR?
                danl_thompson

                Excellent advice, I don't look there often enough!
                Merci du conseil.