The following details how to configure JBPM 5.2 running under Tomcat 7 to run the Demo application using Oracle 11g Express backend vs. the default H2.

It is assumed that:

JBPM 5.2 is running under Tomcat 7 / H2 Demo running.
(See JBPM 5.2 / Tomcat 7 / H2 / Demo)

An Oracle 11g XE instance has been installed and configured with TNS listening on the default port (1521)

NB: Tomcat should be stopped prior to installation.

I have specified Oracle connection parameters to use the ‘dpbmtest‘ user – this user should either be independently created or changed to a user of your choice with appropriate rights within the Oracle instance (eg. Create table etc.).

System is not suggested as other than the obvious issues, Oracle XE works to a single instance database with schema set by user model. This is a break from regular Oracle also.

It is further assumed below that the Oracle express instance is identified as ‘XE’

1: Download required software:

Oracle JDBC Driver (Select latest version)

2: Install Oracle JDBC Driver

Copy downloaded ojdbc6.jar to:

${CATALINA_HOME}/lib

jbpm-installer/db/driver

NB: The second step is required for the demo human-task-service only.

3: Update Tomcat Configuration

a) Update Bitronix configuration.

i) Modify file: ${CATALINA_HOME}/conf/resources.properties to contain following:

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=oracle.jdbc.OracleDriver
resource.ds1.driverProperties.user=dbpmtest
resource.ds1.driverProperties.password=
resource.ds1.driverProperties.url=jdbc:oracle:thin:@localhost:1521:XE
resource.ds1.allowLocalTransactions=true

ii) Update ${CATALINA_HOME}/conf/context.xml

Add following resource declaration – replacing previous H2 entry:

<Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource" maxActive="15" maxIdle="2" maxWait="10000" logAbandoned="true" username="dbpmtest"password="" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:XE"/>

iii) If exists, delete folder: ${CATALINA_HOME}/work

4: Update hibernate configuration for the web console interface

a) Update jpbm-console

i) Update file:

${CATALINA_HOME}/webapps/jbpm-console/WEB-INF/classes/hibernate.cfg.xml

Set configuration to:

<hibernate-configuration>
<session-factory>
<!– Database connection settings –>
<property name=”connection.driver_class”>oracle.jdbc.OracleDriver</property>
<property name=”connection.url”>jdbc:oracle:thin:@localhost:1521:XE</property>
<property name=”connection.username”>dbpmtest</property>
<property name=”connection.password”></property>
<!– JDBC connection pool (use the built-in) –>
<property name=”connection.pool_size”>1</property>
<!– SQL dialect –>
<property name=”dialect”>org.hibernate.dialect.OracleDialect</property>
<!– Enable Hibernate’s automatic session context management –>
<property name=”current_session_context_class”>thread</property>
<!– Disable the second-level cache –>
<property name=”cache.provider_class”>org.hibernate.cache.NoCacheProvider</property>
<!– Echo all executed SQL to stdout –>
<property name=”show_sql”>false</property>
<!– Drop and re-create the database schema on startup –>
<property name=”hbm2ddl.auto”>create</property>
<mapping resource=”AuditLog.hbm.xml”/>
</session-factory>
</hibernate-configuration>

b) Update gwt-console-server

i) Update file:

${CATALINA_HOME}/webapps/gwt-console-server/WEB-INF/classes/hibernate.cfg.xml

Set configuration to:

<hibernate-configuration>
<session-factory>
<!– Database connection settings –>
<property name=”connection.driver_class”>oracle.jdbc.OracleDriver</property>
<property name=”connection.url”>jdbc:oracle:thin:@localhost:1521:XE</property>
<property name=”connection.username”>dbpmtest</property>
<property name=”connection.password”></property>
<!– JDBC connection pool (use the built-in) –>
<property name=”connection.pool_size”>1</property>
<!– SQL dialect –>
<property name=”dialect”>org.hibernate.dialect.OracleDialect</property>
<!– Enable Hibernate’s automatic session context management –>
<property name=”current_session_context_class”>thread</property>
<!– Disable the second-level cache –>
<property name=”cache.provider_class”>org.hibernate.cache.NoCacheProvider</property>
<!– Echo all executed SQL to stdout –>
<property name=”show_sql”>false</property>
<!– Drop and re-create the database schema on startup –>
<property name=”hbm2ddl.auto”>create</property>
<mapping resource=”AuditLog.hbm.xml”/>
</session-factory>
</hibernate-configuration>

ii) Update file:

${CATALINA_HOME}/webapps/gwt-console-server/WEB-INF/classes/META-INF/persistence.xml

Set content to:

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.drools.persistence.info.SessionInfo</class>
<properties>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.username" value="dbpmtest"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.connection.autocommit" value="true" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>

5: Update configuration of demo ‘human-task-service’

NB: The human-task-service is responsible for creating the ‘test’ demo database objects within the XE / dbpmtest schema – this and following step represents a partial test of the Oracle connectivity and above configurations.

a) Update persistence configuration file:
jbpm-installer/task-service/target/META-INF/persistence.xml

Set ‘properties’ contents to:

<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:XE" />
<property name="hibernate.connection.username" value="dbpmtest"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
</properties>

6: First test of the new setup: Start the evaluation human task server.

Change to jpbm-installer folder and execute: ant start.human.task

NB:You will receive errors relating to JDBC connection if there is a problem with either the persistence settings configured in Step 5, or your Oracle setup.

If your local persistence required tweaking be sure to cross check the console persistence file settings updated in Step 4/b/ii above.If the human task service has started successfully it is safe to proceed.

7:  Test console

a) Start Tomcat

b) Navigate to:

http://localhost:8080/jpbm-console


Trouble Shooting

If errors are reported in the console which appear to be connected with database connectivity, verify that the test database has been created within Oracle, and check carefully the hibernate settings mentioned above.


Additional Links / Resources

Hibernate Dialect Cross Reference

Advertisements