Version 5

    For running jBPM 3.2 on Tomcat see this page

    -


     

     

    JBoss jBPM : Java Business Process Management on Tomcat with MySQL or HSQLDB

     

    Fabricio Garcia Imbrizi, MURAH Technologies, www.murah.com.br

     

    03/18/2005

     

    1. CONSIDERATIONS

     

    Many people have difficulties to install jBPM in the Tomcat with Mysql or HSQLDB database. I wrote this manual based in this difficulties and Users and Developers forums.

     

    All information describes in this document can be found in the JBoss jBPM official web site, Users and Developers Forums and JBoss official web site.

     

    I would like to thanks Tom Baeyens, Jan-Philipp Bolle, Stephane Carrez and all persons that contributed with questions. All credits goes to the authors.

     

    2. TEST ENVIRONMENT

     

    2.1. Systems

     

    • Operation System Windows XP

     

     

     

     

     

    2.2.     Libraries

     

     

     

    2.3.     Environment Variables

     

    These are the variable that must be set on operations system:

    • ANT_HOME - Root Ant Directory

    • JAVA_HOME - Root Java SDK Directory

    • Include the follow on variable PATH:

    • JAVA_HOME/bin

     

    3. JBoss jBPM, Tomcat and MySQL

     

    To use the JBoss jBPM example, follow the steps:

     

    3.1.     Root Directory

     

    Unzip the jboss-jbpm-2.zip in the folder of your choice.  I considered this folder as .

     

    3.2.     Alter <JBPM_HOME>/build.properties

     

    Remove all code and insert:

     

    • jbpm.home=<JBPM_HOME>

    • ant.home=<ANT_HOME>

    • jboss.home=

    • jbpm.pde=

     

    , than:

     

    jboss.home and jbpm.pde can be empty.

     

    3.3.     Alter <JBPM_HOME>/core/schema.generation.properties

     

    Remove all code and insert:

     

    hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect

     

    hibernate.connection.driver_class=com.mysql.jdbc.Driver

     

    hibernate.query.substitutions=true=1, false=0

     

    hibernate.connection.url=jdbc:mysql://localhost:3306/jbpm

     

    hibernate.connection.username= is the password of that user on database.

     

    3.4.     Alter <JBPM_HOME>/web/src/jbpm.war/WEB-INF/classes/jbpm.properties

     

    Remove all code and insert:

     

    jbpm.log.stdout=off

     

    hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect

     

    hibernate.connection.driver_class=com.mysql.jdbc.Driver

     

    hibernate.query.substitutions=true=1, false=0

     

    hibernate.connection.url=jdbc:mysql://localhost:3306/jbpm

     

    hibernate.connection.username= is the password of that user on database.

     

    3.5.     Alter <JBPM_HOME>/core/src/java/org/jbpm/model/definition/impl/DelegationImpl.hbm.xml

     

    Replace

     

     

     

     

    3.6.     Alter <JBPM_HOME>/core/src/java/org/jbpm/model/definition/impl/FileImpl.hbm.xml

     

    Replace 

     

     

     

     

    3.7.     Alter <JBPM_HOME>/core/src/java/org/jbpm/persistence/hibernate/HibernateSession.java

     

    Replace

     

    private static final String latestDefinitionQuery = "select d " 

     

       + "from d in class org.jbpm.model.definition.impl.DefinitionImpl "

     

       + "where d.name = ? "

     

       + " and d.version = ( " 

     

       + " select max(d2.version) "

     

       + " from d2 in class org.jbpm.model.definition.impl.DefinitionImpl "

     

       + " where d2.name = d.name )";

     

     

    to

     

    private static final String latestDefinitionQuery = "select d "

     

       + "from d in class org.jbpm.model.definition.impl.DefinitionImpl "

     

       + "where d.name = ? "

     

       + " order by d.version desc "; 

     

     

    3.8.     Alter <JBPM_HOME>/core/src/java/org/jbpm/model/execution/impl/VariableInstanceImpl.hbm.xml

     

    Replace

     

     

     

     

    3.9.     Alter <JBPM_HOME>/core/src/java/org/jbpm/model/log/impl/ExecutionLog.hbm.xml

     

    Replace

     

     

     

     

    3.10.     Alter <JBPM_HOME>/core/build.xml

     

    In target

     

    3.11.     Terminal

     

    Open a console in directory /core

     

    3.12.     Generate DDL SQL script

     

    Execute the ant target �&131;¢�&130;�&128;�&130;�&152;generate.ddl�&131;¢�&130;�&128;�&130;�&153; with command 'ant generate.ddl' in /core/target/sql/create-jbpm-database.sql

     

    3.13.     MySQL Connector/J to deploy

     

    Add MySQL Connector/J on /lib

     

    3.14.     Database Creation

     

    Create a new database with the name jbpm on MySQL.

     

    3.15.     Deploying JBoss jBPM

     

    Execute the ant target �&131;¢�&130;�&128;�&130;�&156;deploy�&131;¢�&130;�&128;�&130; with command ant deploy in /web

     

    3.16.     Deploying a process archive

     

    Verify if your database is running. If not, start it.

    Execute the ant target �&131;¢�&130;�&128;�&130;�&156;deploy.process.archives�&131;¢�&130;�&128;�&130; with command ant deploy.process.archives in /web

     

    3.17.     Deploying JBoss jBPM on Tomcat

     

    Copy

     

    3.18.     MySQL Connector/J on Tomcat

     

    Add MySQL Connector/J on /WEB-INF/lib

     

    3.19.     Commons Digester

     

    Add the jar file commons-digester.jar on /WEB-INF/lib

     

    JBoss jBPM, Tomcat and HSQLDB

     

    To use the JBoss jBPM example, follow the steps:

     

    4.1.     Root Directory

     

    Unzip the jboss-jbpm-2.zip in the folder of your choice.

    I considered this folder as .

     

    4.2.     Alter <JBPM_HOME>/build.properties

     

    jbpm.home=

     

    jboss.home=

     

    jbpm.pde=

     

     

    , than:

     

    jboss.home and jbpm.pde can stay empty.

     

    4.3.     Alter <JBPM_HOME>/web/src/jbpm.war/WEB-INF/classes/jbpm.properties

     

    Replace the port of database:     

     

    hibernate.connection.url=jdbc:hsqldb:hsql://localhost: is the number of port where HSQLDB is running. Normally is 9001.

     

    4.4.     Terminal

     

    Open a console in directory /web

     

    4.5.     Deploying JBoss jBPM

     

    Execute the ant target �&131;¢�&130;�&128;�&130;�&156;deploy�&131;¢�&130;�&128;�&130; with command ant deploy in /web

     

    4.6.     Deploying a process archive

     

    Verify if your database is running. If not, start it.

     

    Execute the ant target �&131;¢�&130;�&128;�&130;�&156;deploy.process.archives�&131;¢�&130;�&128;�&130; with command ant deploy.process.archives in /web

     

    4.7.     Deploying JBoss jBPM on Tomcat

     

    Copy

     

    4.8.     HSQLDB Drives

     

    Copy the jar files  /WEB-INF/lib

     

    4.9.     Commons Digester

     

    Add the jar file commons-digester.jar on /WEB-INF/lib

     

    References

     

    Commons Digester - http://jakarta.apache.org/site/downloads/downloads_commons-digester.cgi

     

    Developers forum - http://sourceforge.net/forum/forum.php?forum_id=240086

     

    JBoss jBPM - http://www.jbpm.org or http://www.jboss.com/products/overview/jbpm

     

    JBoss jBPM 2.0 - http://sourceforge.net/project/showfiles.php?group_id=70542&package_id=117680

     

    MySQL 4.1.8 - http://dev.mysql.com/downloads/mysql/4.1.html

     

    MySQL Connector/J - http://dev.mysql.com/downloads/connector/j/3.1.html

     

    Tomcat 5.0.18 - http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi

     

    Users forum - http://sourceforge.net/forum/forum.php?forum_id=240085