Search code examples
jbosswildflydroolsjbpmkie

How to change default H2 database to Postgresql for Kie Workbench (JBPM 7.2.0) running under existing under Wildfly (10.1.0) manually?


I have an existing Wildfly installation containing other apps. Besides that I want to deploy Kie Workbench too. Here I do not want to use the demo installation using Ant, which starts downloading and installing JBoss afresh.

My existing environment is below.

OS: Windows Server 
Database: Postgres 9.6.1 
JDBC: postgresql-42.1.4.jar
App Server: wildfly-10.1.0.Final
BPM/Drools App: kie-wb-7.2.0.Final-wildfly10.war

I deployed the Kie Workbench by downloading the war file from here: https://repo1.maven.org/maven2/org/kie/kie-wb/

Now I would like to change the default H2 database driver with Postgresql 9.6.

Prior to this I created users and datasources already and had a workable kie-wb site, but only problem is: it is running on H2.

Any help appreciated in replacing H2 with Postgresql driver.


Solution

  • I performed the below steps. But somewhere I went wrong, not sure where. I am unable to login to the kie workbench.

    JBPM App Server Configuration for PostgreSQL

    1. Uncompress the zip file: jbpm-installer-full-7.2.0.Final build.properties file
    2. Update release.version=7.2.0.Final in
    3. Remove references of H2 in build.properties file
    4. Add postgresql references in build.properties file including jdbc driver details and download url
    5. Change H2 hibernate dialect to that of PostgreSQLDialect in jbpm-persistence-JPA2.xml file
    6. Change all H2 reference and replace with PostgreSQL in standalone-wildfly-10.1.0.Final.xml, standalone-full-wildfly-10.1.0.Final.xml files
    7. Change default datasource to jBPMDS in those two files:
    8. Upload Postgres Driver and create module.xml file with the postgresql driver using JBOSS-CLI commands.
    9. Issue the below ant commands from the directory of the expanded zip files:

      ant clean.generated.ddl

      ant download.ddl.dependencies

      ant install.jboss

      ant install.jBPM-console.into.jboss

    10. Make sure standalone.xml and standalone-full.xml are being copied into the Wildfly configuration directory correctly.

    11. Move the wildfly directory to the location of the JBOSS_HOME, or create environment variable pointing to the same.

    12. Create the directory modules\org\postgresql\main in JBOSS_HOME home and copy files: module.xml, postgresql-42.1.4.jar

    13. Add admin user in the Management Realm: admin

    14. Add JBPM users with roles in braces in Application Realm: kieserver(kie-server), workbench(admin,kie-server)
    15. Run the sql scripts from ddl_dependency folder as the ant script is failing.
    16. Issue standalone -b 0.0.0.0 -c standalone-full.xml command

    Bing! you are done!