7 Replies Latest reply on Mar 29, 2008 9:44 PM by aguizar

    How to programatically deploy a PAR to a remote JBoss instal

    nnelgp

      For example, I have an EJB that has the PAR bytes running in JBoss A on machine A, and I want to programatically deploy the PAR to JBoss B running on machine B.

      Thanks,
      Glenn

        • 1. Re: How to programatically deploy a PAR to a remote JBoss in
          cpob

          If you check the JUnit tests, org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java has examples on how to build a simple .par, as well as deploy it.

          The deploy:

          ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream("your/par/file/name/here"));
           ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
           jbpmContext.deployProcessDefinition(processDefinition);


          You just need to worry about getting the PAR from machine A to machine B. You could do it as a HTML Multipart Post, or FTP, or however you want. Anyway to get the file physically to the other machine (with a known path) is the pain point of your issue.

          • 2. Re: How to programatically deploy a PAR to a remote JBoss in
            nnelgp

            So there is not an MBean whose JMX interface includes methods for deploying a PAR. I was hoping I could create a remote JMX connection to the MBean and get it to machine B that way. Is there an MBean that can do this or would I have to write my own.

            Thanks,
            Glenn

            • 3. Re: How to programatically deploy a PAR to a remote JBoss in
              cpob

              Unfortunately, no.

              According to the FAQ in the Wiki:

              Does jBPM have JMX integration and if so, how does it look like?

              In the starters-kit, jBPM comes deployed as an MBean. But for the moment, this mbean is only used to put the JbpmConfiguration? in JNDI. No properties or management operations are available yet on this MBean.


              • 4. Re: How to programatically deploy a PAR to a remote JBoss in
                nnelgp

                My plan then is to write my own mbean that I can access remotely via JMX to deploy a PAR. Thanks for the info.

                • 5. Re: How to programatically deploy a PAR to a remote JBoss in
                  koen.aers

                  You can leverage the deployment servlet in the jBPM webapp if you like... But I agree that an MBean could be a better solution. Let us know if you are planning to contribute ;-)

                  Cheers,
                  Koen

                  • 6. Re: How to programatically deploy a PAR to a remote JBoss in
                    lafbarbosa

                    Hi guys,

                    I've been looking for a way to do the deployment of .esb archives into server/default/deploy directory of JBoss AS running JBossESB inside or JBossESB server, but I didn't find anything related.

                    Please, nnelgp, did you make your MBean?

                    I think it could be useful to deploy other kinds of archives into JBoss * servers.

                    If you made something, please, tell us.

                    Thanks in advance!

                    Regards,

                    Luiz|

                    • 7. Re: How to programatically deploy a PAR to a remote JBoss in
                      aguizar

                      Luiz,

                      Your use case is unrelated to jBPM itself. You should have posted to the ESB forum instead.

                      Anyway, the ESB registers its own deployer in JBoss AS to handle files with the .esb suffix. By doing so, it leverages the existing deployment infrastructure. You can call operations on the main deployer MBean (object name: jboss.system:service=MainDeployer) to deploy modules of any kind known to the deployer.

                      jBPM does not use the main deployer because the lifecycle of process definitions does not match that of modules.