1 2 3 Previous Next 35 Replies Latest reply on Mar 8, 2013 3:32 AM by northly

    jBPM5 Console Integration with Tomcat6

    bpmn2user

      Here are the required steps to get the jBPM5 console running in Tomcat6

       

       

      1.)    Copy the console war files provided in JBPM_INSTALLER/lib into Tomcat’s webapps directory

      These war files can also be downloaded from   (http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.0-CR1/jbpm-5.0-CR1-gwt-console.zip/download). This download has two war files jbpm-gwt-console-5.0-CR1.war and jbpm-gwt-console-server-5.0-CR1.war. Rename them to jbpm-console.war and gwt-console-server.war and copy them to TOMCAT_HOME/webapps

       

      2.)    Create users and roles in TOMCAT_HOME/conf/tomcat-users.xml.

      Here is an example

      <?xml version='1.0' encoding='utf-8'?>

      <tomcat-users>

        <role rolename="tomcat"/>

        <role rolename="role1"/>

        <role rolename="manager"/>

        <role rolename="admin"/>

        <role rolename="user"/>

        <user username="tomcat" password="tomcat" roles="tomcat"/>

        <user username="both" password="tomcat" roles="tomcat,role1"/>

        <user username="role1" password="tomcat" roles="role1"/>

        <user username="manager" password="manager" roles="manager"/>

        <user username="krisv" password="krisv" roles="manager,admin,user"/>

        <user username="john" password="john" roles="manager,admin,user"/>

        <user username="mary" password="mary" roles="manager,admin,user"/>

      </tomcat-users>

       

       

      3.)    Set the jbpm.console.directory in Catalina.bat (.sh)

      Here is an example.

      .. -Djbpm.console.directory=C:/jbpm5/CR1/jbpm-installer/sample/evaluation/src/main/resources ..

       

      4.) Copy JBPM_INSTALLER\jboss-4.2.3.GA server\default\data\birt into TOMCAT_HOME\birt.  This will provide the reporting functionality

       

      5.)    Copy the database driver (e.g., h2.jar) and all the dependant jar files into TOMCAT_HOME/lib.

       

      Here are the required libraries:

       

      jbpm-persistence-jpa-5.0-CR1.jar

      h2-1.2.124.jar

      persistence-api-1.0.jar

      geronimo-jta_1.0.1B_spec-1.0.1.jar

      javassist-3.4.GA.jar

      hibernate-entitymanager-3.4.0.GA.jar

      hibernate-core-3.3.0.SP1.jar

      hibernate-commons-annotations-3.1.0.GA.jar

      hibernate-annotations-3.4.0.GA.jar

      ejb3-persistence-1.0.2.GA.jar

      dom4j-1.6.1.jar

      commons-collections-3.1.jar

      antlr-2.7.6.jar

       

       

      6.)    Start database:

      e.g, run ‘ant h2.start’ from JBPM_INSTALLER directory

       

      7.)    Start human task, e.g., run ‘ant start.human.task’ from JBPM_INSTALLER directory

       

       

      This assumes that a  datasource  JNDI (jdbc/testDS1) is configured in Tomcat and a transaction manager (such as Bitronix or JOTM or Atomikos etc) is configured on Tomcat.

      Refer to http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html for JNDI configuration on Tomcat6.

       

      Login to console http://localhost:8080/jbpm-console (krisv/krisv)

        • 1. Re: jBPM5 Console Integration with Tomcat6
          krisverlaenen

          Great, thanks a lot for providing the details !

          I'll see what I can do to get this into the installer

           

          Kris

          • 2. Re: jBPM5 Console Integration with Tomcat6
            anandintouch

            Hi,

            All required jars including persistence jars as I've out in tomcat_home/lib folder but when i login to web-console ,while loading processes I get error-

            " Could not initialize stateful knowledge session: javax/persistence/Persistence"

            Infact I don't see any exception in server log and in humantask console window.

             

            So it's related to testDS configuration and tranaction manager config for tomcat(i'm using tomcat 5.5)which is causing that exception.

            So where do we need to put testDS and configuration about datasource  JNDI (jdbc/testDS1)and transaction manager in server.xml file of tomcat?

            • 3. Re: jBPM5 Console Integration with Tomcat6
              odelyaholiday
              Can you please explain how to "This assumes that a  datasource  JNDI (jdbc/testDS1) is configured in Tomcat and a transaction manager (such as Bitronix or JOTM or Atomikos etc) is configured on Tomcat."
              • 4. Re: jBPM5 Console Integration with Tomcat6
                anandintouch

                I also did all setup for Tomcat but only issue is with setting up datasource  JNDI and transaction manager.

                I tried putting testDS in gwt-console-server.war web-inf folder ,then I added persistence related jars in Tomcat_Home/lib folder as well,but still same error I get related to finding persistence classes.

                Error-

                Could not initialize stateful knowledge session: No Persistence provider for EntityManager 
                named org.drools.persistence.jpa

                Here is the snippet from server.xml config from Tomcat(below config is the second option I tried)
                -------------------------------------------------------------------------------
                <Context path="/jbpm-console" docBase="C:/Anand/apache-tomcat-5.5.31/webapps/gwt-console-server.war"
                                debug="5" reloadable="true" crossContext="true">

                        <Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
                               maxActive="100" maxIdle="30" maxWait="10000" logAbandoned="true" removeAbandonedTimeout="60" removeAbandoned="true"
                              username="jana" password="jana" driverClassName="oracle.jdbc.OracleDriver"
                               url="jdbc:oracle:thin:@localhost:1521:xe"/>

                      </Context>

                ====================================================================================

                I don't see any error on server log ,only while loading process in web console I get the exception.

                So basically some configuration related to transactionManager and Datasource could be the problem.Let me know if any info on this.

                 

                Thanks,

                Anand

                • 5. Re: jBPM5 Console Integration with Tomcat6
                  bpmn2user

                  If you are using Tomcat 5.5, you might want to follow these instructions

                  http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html.

                   

                  Also, what is the 'root cause' error shown at the end of stack trace?

                  • 6. Re: jBPM5 Console Integration with Tomcat6
                    bpmn2user

                    It is mainly required to setup JNDI in Tomcat (jdbc/testDS1) and it depends on the transaction manager selected and Tomcat version.

                     

                    For example, here is the documentation using Bitronix on Tomcat 6.

                    http://docs.codehaus.org/display/BTM/Tomcat13

                     

                    If this configured as global resource in Tomcat, no changes are required in the jbpm-console.war and gwt-console-server.war. The JNDI will be available globally for all the web applications

                    • 7. Re: jBPM5 Console Integration with Tomcat6
                      bpmn2user

                      'I tried putting testDS in gwt-console-server.war web-inf folder ,then I  added persistence related jars in Tomcat_Home/lib folder as well,but  still same error I get related to finding persistence classes.'

                       

                      Keeping the testDS in web-inf folder would not work with Tomcat. The context.xml file needs to be modified.

                      • 8. Re: jBPM5 Console Integration with Tomcat6
                        anandintouch

                        So here is my configuration on Tomcat 5.5.. and Oracle10 which I'm using .

                         

                        server.xml entry

                        ------------------

                        <Host name="localhost" appBase="webapps"
                               unpackWARs="true" autoDeploy="true"
                               xmlValidation="false" xmlNamespaceAware="false">

                         

                             <Context path="/jbpm-console" docBase="C:/Anand/apache-tomcat-5.5.31/webapps/gwt-console-server.war">
                                    <Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
                                      driverClassName="oracle.jdbc.driver.OracleDriver"
                                        url="jdbc:oracle:thin:@localhost:1521:xe"  username="jana" password="jana" maxActive="20"   maxIdle="10"   maxWait="-1" />
                                </Context>

                         

                        </Host>

                         

                        web.xml entry at gwt-console-server.war\WEB-INF\

                        ----------------------------------------------------------------------

                        <resource-ref>
                          <res-ref-name>jdbc/testDS1</res-ref-name>
                          <res-type>javax.sql.DataSource</res-type>
                          <res-auth>Container</res-auth>
                        </resource-ref>

                         

                        Initially i was getting error while starting tomcat server-

                        So we have "persistence.xml" inside gwt-console-server.war\WEB-INF\classes\META-INF\   which has  datasource(testDS1) entry.So Im not sure if we need to modify this file or not? I tried adding "context.xml" in META-INF with resource entry but that didn't help.

                        We need to tweak persistence.xml I belive to let Tomcat locate datasource and also persistemce.xml uses "org.hibernate.transaction.JBossTransactionManagerLookup" may be this lookup class should be changed.

                         

                        Now after some changes to server.xml ,like change of "docBase" as above,I don't get any error on tomcat server but when I go to browser and enter

                        url (http://localhost:12000/jbpm-console/) then I get following message on the browser.

                         

                        Let me know if you have any fix/suggestion for this.

                         

                        Message on browser

                        ==========================================================================

                        GWT Console Server

                        Published URL's

                        You can find a list of resources here.

                        Example usage

                         

                           curl -u "user:password" -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions

                           curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definition/1/instances

                         

                        Problems?

                        Please post any questions to the gwt-console developer forum.

                         

                         

                        ==========================================================================

                        Thanks,

                        Anand

                        • 9. Re: jBPM5 Console Integration with Tomcat6
                          bpmn2user

                          'We need to tweak persistence.xml I belive to let Tomcat locate   datasource and also persistemce.xml uses "org.hibernate.transaction.JBossTransactionManagerLookup" may be this lookup class should be changed.

                          Let me know if you have any fix/suggestion for this.'

                           

                          Which transaction manager you are using?

                          For example, if you are using Bitronix, you the set the value as follows in persistence.xml :

                          <property name="hibernate.transaction.manager_lookup_class"  value="org.hibernate.transaction.BTMTransactionManagerLookup" />

                           

                          You also need to add the following libraries in Tomcat/lib if you are using Bitronix:

                          e.g,

                          btm-tomcat55-lifecycle-1.3.3.jar

                          slf4j-api-1.5.2.jar

                          slf4j-jdk14-1.5.2.jar

                          btm-1.3.1.jar

                          geronimo-jta_1.0.1B_spec-1.0.1.jar

                           

                          ' I tried adding "context.xml" in META-INF with  resource entry but that didn't help.'

                          This is not required if you define the Global datasource at the Tomcat level as all the web applications can access the JNDI.

                          • 10. Re: jBPM5 Console Integration with Tomcat6
                            anandintouch

                            I've not changed any setting for transaction manager.Whatever is there in jbpm persistence.xml I'm using the same,I tried using BTM transaction recently,so I'm able to see processes in web console but after entering username and submitting first form,it throws exception related to datasource /transaction related exception.But I believe I can make it work,if any issue then will post my queries.

                            Thanks ..Anand

                            • 11. jBPM5 Console Integration with Tomcat6
                              bpmn2user

                               

                              I tried using BTM transaction recently,so I'm able to see processes in web console but after entering username and submitting first form,it throws exception related to datasource /transaction related exception.

                               

                              If you have not changed lookupclass poperty in persistence.xml, you would get an exception as it assumes you are using Jboss transaction manager (see below), whereas you have configured Bitronix.

                               

                              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                              • 12. jBPM5 Console Integration with Tomcat6
                                odelyaholiday

                                So I need to change it to org.hibernate.transaction.JBossTransactionManagerLookup or to org.hibernate.transaction.BTMTransactionManagerLookup if I am using Tomcat?

                                • 13. jBPM5 Console Integration with Tomcat6
                                  bpmn2user

                                  Yes! That is correct.

                                  • 14. jBPM5 Console Integration with Tomcat6
                                    odelyaholiday

                                    what is correct? the org.hibernate.transaction.JBossTransactionManagerLookup?

                                    1 2 3 Previous Next