Here are the required steps to get the jBPM5 console running in Tomcat6, h2 database and Bitronix transaction manager.

 

 

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-Final/). This download has two war files jbpm-gwt-console-5.0.0.war and jbpm-gwt-console-server-5.0.0.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.

 

If you use other databases such as Oracle, Mysql etc, you need to copy the corresponding jar files (http://community.jboss.org/thread/161643)

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

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

 

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

You can also integrate the human task service as a startup servlet (http://community.jboss.org/thread/161260)

 

     8.) Configure a datasource JNDI (jdbc/testDS1) using Bitronix transaction manager.

 

You can also refer to Bitronix (e.g., http://docs.codehaus.org/display/BTM/Tomcat13)  and Tomcat JNDI (http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html) configuration documentation.

 

     a.) Create the following btm-config.properties in TOMCAT_HOME/conf

 

bitronix.tm.serverId=tomcat-btm-node0

bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog

bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog

bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

 

    b.) Add transaction and Resource information after 'WatchedResource' line in TOMCAT_HOME/conf/context.xml as shown below.

 

.........

..........

<WatchedResource>WEB-INF/web.xml</WatchedResource>

    <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

 

    <Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"

               maxActive="15" maxIdle="2" maxWait="10000"

logAbandoned="true"

               username="sa" password=""

driverClassName="org.h2.jdbcx.JdbcDataSource"

               url="jdbc:h2:tcp://localhost/~/test"/>

..........

.........

 

c.) Create 'resource.properties' in TOMCAT_HOME/conf as shown below.

 

resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource

resource.ds1.uniqueName=jdbc/testDS1

resource.ds1.minPoolSize=0

resource.ds1.maxPoolSize=5

resource.ds1.driverProperties.driverClassName=org.h2.jdbcx.JdbcDataSource

 

d.) Modify TOMCAT_HOME/conf/server.xml to include BTMLifecycleListener after the line that has GlobalResourcesLifecycleListener as shown below.

 

.........

<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />

....

 

e.) Modify TOMCAT_HOME\webapps\gwt-console-server\WEB-INF\classes\META-INF\persistence.xml to include the Bitronix value  for hibernate.transaction.manager_lookup_class as shown below.

 

.

....

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

...

 

 

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