7 Replies Latest reply on Sep 20, 2004 10:46 AM by yueming

    How to remotely deploy a MBean service using JBoss API?

    yueming

      Hi there,
      I'd like to deploy my MBean service sar to a remote JBoss server, is there a way to do that using some MBean's API via RMIAdaptor?
      Thanks in advance!
      Yueming

        • 1. Re: How to remotely deploy a MBean service using JBoss API?
          dimitris

          If you can get to the point of having a connection to the remote MBean server, you can call deploy(URL) on the MainDeployer.

          Your archive will be then started from the provided URL

          /Dimitris

          • 2. Re: How to remotely deploy a MBean service using JBoss API?
            yueming

            Thanks, Dimitris! That works!
            Yueming

            • 3. Re: How to remotely deploy a MBean service using JBoss API?
              yueming

              Hi,
              MainDeployer.deploy(URL) can deploy a sar remotely, but once when I shut down JBoss and restart, the deployed module by MainDeployer is lost, it seems JBoss won't persist the deployment made by MainDeployer. Am I missing something here? or could somebody shed some lights on?

              Thanks,
              Yueming

              • 4. Re: How to remotely deploy a MBean service using JBoss API?
                raja05

                Yes its not persisted..The deployment state is not stored . The only way possible to have deployments of archives at startup is to store it somewhere accessible to jboss and point that as a deploy directory in jboss-service.xml

                • 5. Re: How to remotely deploy a MBean service using JBoss API?
                  yueming

                  Hi there,
                  Thanks very much for your previous reply! But I found a problem,
                  when my client code is running on the same machine with JBoss, everything works fine; if I run JBoss on a different machine, when I use MainDeployerMBean.deploy(URL) (I get the proxy object for MainDeployer from MBeanServerInvocationHandler), it always throws exception:
                  org.jboss.deployment.DeploymentException: url file:/D:/myservice.sar could not be opened, does it exist?
                  at org.jboss.deployment.DeploymentInfo.(DeploymentInfo.java:168)

                  The proxy object seems doesn't transfer myservice.sar to the remote JBoss via RMI. Is there a workaround for this? That is I need deployment happens at the client side, is that possible? Or maybe there is a way I can upload myservice.sar first to the remote JBoss's temporary working folder and then start the deployment using that URL?
                  I'd appreciate your help very much!

                  Yueming

                  • 6. Re: How to remotely deploy a MBean service using JBoss API?
                    genman


                    The URL you are giving is the one JBoss uses to connect to the client. What you're using is a URL valid only on the client side.

                    If you want to deploy remotely, the client needs to make the file available remotely somehow. You could create a .jsp which took a file via HTTP and then deployed it.

                    • 7. Re: How to remotely deploy a MBean service using JBoss API?
                      yueming

                      Thanks for your reply! But could you give an example, I don't know how to use jsp to do the deployment work, is there some document somewhere?

                      Yueming