6 Replies Latest reply on Nov 22, 2007 4:44 AM by bfillon

    Multiple JBPM engines on one single JBoss instance

      Hi all,

      I've got a question regarding the deployment of JBPM.
      Is it possible to imagine multiple instances of JBPM (each one with its own database for processes and definitions) running on one single JBoss instance ?
      I would like to do this for testing purposes to avoid the configuration of multiple JBoss instances, each one dedicated to a single staging environment.
      If it is possible, is there any documentation out there explaining how to do so ?

      Thanks for your answers,
      Regards,
      Benoit

        • 1. Re: Multiple JBPM engines on one single JBoss instance
          vtysh

          It's easy, simply edit hibernate.cfg.xml file for another datasources which you have.

          • 2. Re: Multiple JBPM engines on one single JBoss instance

            I've made some basic tests with two ears containing :
            - jbpm.war
            - hibernate.cfg.xml
            - jbpm.cfg.xml

            Let's say ears are called app1.ear and app2.ear. They both contain the same structure and files and hibernate.cfg.xml files use distinct JNDI datasources defined in jbpm-ds.xml.

            What i see when starting JBoss and hot-deploying applications one by one is the following :
            - I deploy app1.ear and application starts correctly and JBPM objects are mapped through Hibernate using config information for datasource 1
            - I deploy app2.ear and application starts correctly but JBPM objects are not mapped a second time using config information for datasource 2. This results in app2.ear using processes and definition from JBPM database 1...

            That's why i was asking myself if such a scenario is possible with JBPM.
            Any idea ?

            Regards,
            Benoit

            • 3. Re: Multiple JBPM engines on one single JBoss instance
              vtysh

              You should use different war names to avoid conflicts.

              • 4. Re: Multiple JBPM engines on one single JBoss instance
                mputz

                I haven't tried what you are trying to achieve, but it sounds like you run into this issue of both applications using the same jars/resources because of the flat class loading model JBoss uses.

                See http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration for more information, and try it again after inserting a jboss-app.xml in your ear files with class loader isolation settings as outlined in the wiki. And also set a different context to the jBPM web applications.

                • 5. Re: Multiple JBPM engines on one single JBoss instance
                  kukeltje

                  Martin is right, and different war names are not needed if they are in different ear files

                  • 6. Re: Multiple JBPM engines on one single JBoss instance

                    Ok that did the trick :
                    I've set attribute "Isolated" to true in ear-deployer.xml.
                    The remaining question is : do I need to set "CallByValue" attribute to true ?
                    If i understand correctly this setting, it is needed for remote calls.
                    If my ears are "standalone" apps that embed everything needed and don't interact with any other Java app, i don't need it, right ?
                    Because it seems that this setting has a non-neglectable impact on performance.

                    Thanks for your answers,
                    Regards,
                    Benoit