Tutorial 1: mySQL configuration and JBoss EAP Data Source Setup - redhat-consulting/jbpm-ee GitHub Wiki

Watch the video

##Prerequisites##

###MySQL Configuration### Log in to mysql as the root user, and execute the statements below.

-- create jbpm user with password jbpm
CREATE USER 'jbpm'@'localhost' IDENTIFIED BY 'jbpm';
-- create jbpm database
create database jbpm;
-- create `jbpm-timers` database
create database `jbpm-timers`;
-- grant all privileges on jbpm-timers and jbpm to jbpm user on localhost
GRANT ALL ON jbpm.* TO 'jbpm'@'localhost';
GRANT ALL ON `jbpm-timers`.* TO 'jbpm'@'localhost';
-- flush privileges
flush privileges;
exit;

test connection to jbpm from command line

mysql -u jbpm -p jbpm
mysql -u jbpm -p jbpm-timers

Download unzip and import the jbpm-ee ddl into jbpm Download jbpm-ee

mysql -u jbpm -p jbpm < jbpm-ee/jbpm-ee-services/resources/database/jbpm-mysql.sql

Download and import quartz ddl into jbpm-timers Download quartz v. 1.8.6

mysql -u jbpm -p jbpm-timers < quartz/docs/dbTables/tables_mysql_innodb.sql

If you completed all the tasks so far, you should have a mysql user 'jbpm' with password 'jbpm' and two databases, jbpm, and jbpm-timers, and the jbpm user will have administrative access to the two databases. The last statement imports the database objects that quartz needs to work properly.

To undo these changes execute the following SQL statements as the mysql root user:

-- remove mysql jbpm user
drop user 'jbpm'@'localhost';
-- drop the jbpm datasources
drop database `jbpm-timers`;
drop database jbpm;

###JBoss EAP 6 Datasource setup###

  • Download Jboss EAP 6 from the Application Platform section of the Customer Portal

  • Create mysql driver module

    • When you are finished creating the module you should have a directory structure similar to
com
|____mysql
| |____main
| | |____module.xml
| | |____mysql-connector-java-5.X.XX.jar
  • Create this structure by
cd jboss-eap/modules
mkdir -p com/mysql/main
cp /path/to/mysql-connector-java-5.X.XX.jar com/mysql/main

Create a file called module.xml in com/mysql/main/

vim com/mysql/main/module.xml

Make sure the file has the following content

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
  <resources>
    <resource-root path="mysql-connector-java-5.X.XX.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

Please replace the mysql-connector-java-5.X.XX.jar in the file name with your driver version.

  • Back-up standalone-full.xml
cp standalone/configuration/standalone-full.xml standalone/configuration/standalone-full.xml.bak
  • Set the jbpm-ee User Group Callback properties to file based User Group Callback via a system property. Please change the path to your user group callback properties file. There is a sample of this file in jbpm-ee/jbpm-ee-services/resources/. More Information
<system-properties>
    <property name="jbpm.ee.user.group.callback.file.properties" value="/path/to/usergroup.properties"/>
    <property name="jbpm.ee.database.configuration.type" value="MySQL"/>
</system-properties>
  • Set the jbpm-ee database configuration type to mysql via a system property. More Information
<system-properties>
    <property name="jbpm.ee.user.group.callback.file.properties" value="/path/to/usergroup.properties"/>
    <property name="jbpm.ee.database.configuration.type" value="MySQL"/> <!-- case insensitive -->
</system-properties>
  • Add mysql driver configuration to standalone-full.xml
vi standalone/configuration/standalone-full.xml

Add the following XML snippet under the <subsystem xmlns="urn:jboss:domain:datasources:1.1"> tag's <drivers> child tag.

<driver name="mysql" module="com.mysql">
    <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
* Start the server

bin/startup.sh -c standalone-full.xml


deploy datasource.xml files into standalone/deployments
⚠️ **GitHub.com Fallback** ⚠️