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

    hot deploy and redeploy of mbeans

    ron pfeifle Newbie

      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?


        • 1. Re: hot deploy and redeploy of mbeans
          Adrian Brock Master

          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.


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

            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.


            • 3. Re: hot deploy and redeploy of mbeans
              Sjus Newbie

              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!!

              • 4. Re: hot deploy and redeploy of mbeans
                Adrian Brock Master

                Looks ok from your description.

                Can you post the output for

                jar -tf Hotdeploytest.sar


                • 5. Re: hot deploy and redeploy of mbeans
                  Sjus Newbie

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

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


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