2.6. Configuring a Datasource for JBoss Enterprise Application Platform 6
The default configuration uses embedded databases that are not suitable or supported for production environments. Before deploying into a production environment this configuration must be changed to a supported database.
For a list of supported database please see http://www.redhat.com/resourcelibrary/articles/jboss-enterprise-brms-supported-configurations
The following procedure uses a PostgreSQL database as an example.
Procedure 2.4. Configuring a Datasource for JBoss Enterprise Platform 6
- Add a directory for the database to the JBoss Enterprise Application Platform 6 directory structure. The directory should be named for the database that will be used. For instance, for a PostgreSQL database create the following structure:
jboss-eap-6.0/modules/org/postgresql/
For a MySQL database, create the following structure:jboss-eap-6.0/modules/com/mysql/
- Download the corresponding JBDC driver for the database.
- Create a
main
directory in the directory created for the database:jboss-eap-6.0/modules/org/postgresql/main/
Copy the JBDC driver into thejboss-eap-6.0/modules/org/postgresql/main/
directory. - Create a
module.xml
file and save it tojboss-eap-6.0/modules/org/postgresql/main/
with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the profile configuration file, for instance,
jboss-eap-6.0/standalone/configuration/standalone.xml
configured for a PostgreSQL database calledjbpmDS
, and a user called sa with a password sa:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
jboss-eap-6.0/standalone/deployments/business-central-server.war/WEB-INF/classes/META-INF/persistence.xml
file and change the hibernate dialect to PostgreSQL:<jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source> . . <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source> . . <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
jboss-eap-6.0/standalone/deployments/jbpm-human-task.war/WEB-INF/classes/META-INF/persistence.xml
file and change the hibernate dialect to PostgreSQL:<non-jta-data-source>java:jboss/datasources/jbpmDS</non-jta-data-source> . . <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<non-jta-data-source>java:jboss/datasources/jbpmDS</non-jta-data-source> . . <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow