5 Replies Latest reply on Jan 31, 2002 6:57 AM by sjus00

    hot deploy and redeploy of mbeans

    ronpfeifle

      I'm a bit confused about hot deploy/redeploy of mbeans. I'd like to deploy some mbeans in the exactly same way, and at the same time, as ejb's (ie, brand-new class files that could be different from last time, etc...)

      I'm unclear on exactly how this works -- I understand how to put a new stanza in the jboss.jcml file, but this isn't hot deployment.

      Would some kind soul please respond with the high-level of how this works?

      Thanks!

        • 1. Re: hot deploy and redeploy of mbeans

          There is no direct support for hot deploying MBeans
          in 2.4.4, it is there in 3.0 Service Deployer.

          I believe the new brand new unified deployer in 3.0
          allows MBeans, wars, ears, etc. etc. to be deployed and
          started together all sharing the same classloader.

          You can however do some of what you want manually in
          2.4.4 using either http://localhost:8082 or the RMI JMX connector.

          Regards,
          Adrian

          • 2. Re: hot deploy and redeploy of mbeans
            marc.fleury

            in 3.0

            if you have services that depends on EJB, then the simple is to create a "SAR" that contains the classes like a jar and the META-INF/jboss-service.xml file that contains the snippet of XML from the jcml file (just copy over). Then the EJB classes in fact the whole JAR can be embedded in the SAR (at the top level) and that will make sure that the service will be deployed with the bean and after the bean.

            You can do it the other way around, have the JAR, standard from teh spec and include a SAR in it and the service will deploy.

            I am about to write whitepapers on this.

            marcf

            • 3. Re: hot deploy and redeploy of mbeans
              sjus00

              I tried this hot deploy. Put in a sar-file the classes of a simple MBean and a META-INF/jboss-service.xml
              with following code:

              <?xml version="1.0" encoding="UTF-8"?>





              But I get this exception:

              [10:47:22,694,ServiceDeployer] Problem deploying url file:/C:/jboss-Tomcat/jboss/deploy/lib/Hotdeplo
              ytest.sar, no valid service.xml file found.
              org.jboss.deployment.DeploymentException: No META-INF/jboss-service.xml found in alleged sar!
              at org.jboss.deployment.ServiceDeployer.deployLocalClasses(ServiceDeployer.java:301)
              at org.jboss.deployment.ServiceDeployer.deploy(ServiceDeployer.java:178)
              at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:107)
              at java.lang.reflect.Method.invoke(Native Method)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
              at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
              at java.lang.Thread.run(Unknown Source)


              What did I wrong?
              Many thanx in advance!!
              Sjus

              • 4. Re: hot deploy and redeploy of mbeans

                Looks ok from your description.

                Can you post the output for

                jar -tf Hotdeploytest.sar

                Regards,
                Adrian

                • 5. Re: hot deploy and redeploy of mbeans
                  sjus00

                  Thank you very much, warjort!!!!! 8-))))

                  I found the error. When I tried
                  jar -tf Hotdeploytest.sar:

                  META-INF/
                  META-INF/MANIFEST.MF
                  simple/PKW.class
                  simple/PKWMBean.class
                  Meta-inf/
                  Meta-inf/jboss-service.xml

                  So it was only an error with the capital-letters in the batch-file to make this sar...
                  But now it works!!
                  Great!
                  Sjus