Search code examples
hibernatejdbcwildflyjbpmpostgresql-9.6

jBPM 7.3.0 persistence with Postgres 9.6


I'm trying to set the persistence in jbpm-installer-7.3.0.Final with Postgres 9.6.

After MANY attempts, I am able to start the server and the console without errors, but from the workbench interface, I'm unable to use Processes or Tasks.

It shows a popup saying:

Process Definitions could not be loaded. Check if the jBPM Capabilities are enabled and if the remote server is correctly set up.

in the Wildfly deployment console I can see:

[org.jbpm.workbench.ks.integration.KieServerDataSetManager] (kieserver) Not possible to register queries on server default-kieserver@localhost:8080 most likely due to BPM capability missing (details Server that this client is connected to has no capabilities to handle QueryServicesClient)

even if the response from the Kie server, seems to allow everything (it's the same as for H2, that works fine)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Kie Server info">
    <kie-server-info>
        <capabilities>KieServer</capabilities>
        <capabilities>BRM</capabilities>
        <capabilities>BPM</capabilities>
        <capabilities>CaseMgmt</capabilities>
        <capabilities>BPM-UI</capabilities>
        <capabilities>BRP</capabilities>
        <capabilities>DMN</capabilities>
        <capabilities>BPMQueries</capabilities>
        <location>http://localhost:8080/kie-server/services/rest/server</location>
        <messages>
            <content>Server KieServerInfo{serverId='default-kieserver', version='7.3.0.Final', location='http://localhost:8080/kie-server/services/rest/server', capabilities=[KieServer, BRM, BPM, CaseMgmt, BPM-UI, BRP, DMN, BPMQueries]}started successfully at Mon Oct 02 17:45:00 CEST 2017</content>
            <severity>INFO</severity>
            <timestamp>2017-10-02T17:45:00.138+02:00</timestamp>
        </messages>
        <name>default-kieserver</name>
        <id>default-kieserver</id>
        <version>7.3.0.Final</version>
    </kie-server-info>
</response>

Here are the steps I took to set Postgres

I'm assuming all the previous steps are done, the ones you do for the H2 Demo setup

  • SET wildfly-10.1.0.Final\modules\org\postgresql\main\module.xml

    <resource-root path="postgresql-42.1.4.jar"/>

    (The JAR is in the same directory - this is the driver for Postgres 9.6 JDBC 4 JDK 8)

  • Change standalone-full.xml

        <datasources>
            <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:postgresql:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                <driver>postgresql</driver>
                <security>
                    <user-name>jbpm</user-name>
                    <password>jbpm</password>
                </security>
            </datasource>
            <datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="PostgresqlDS" enabled="true" use-java-context="true" use-ccm="true">
                <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url>
                <driver>postgresql</driver>
                <security>
                    <user-name>jbpm</user-name>
                    <password>jbpm</password>
                </security>
            </datasource>
            <drivers>
                <driver name="postgresql" module="org.postgresql">
                    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
                </driver>
            </drivers>
        </datasources>
    
  • I ran the ddl scripts on a jbpm database, with jbpm schema and user

psql -h localhost -f postgresql-jbpm-schema.sql jbpm jbpm

psql -h localhost -f postgresql-jbpm-lo-trigger-clob.sql jbpm jbpm

  • I wanted to avoid ant to start the server, so I replicated the Wildfly 10.1.0 launch string

    (first, I set a JAVA_OPTS var, to raise the max java heap size: -Xms512m -Xmx2G)

wildfly-10.1.0.Final\bin\standalone.bat -b localhost --server-config=standalone-full.xml -Dorg.kie.demo=false -Dorg.kie.example=false -Dorg.kie.server.id=default-kieserver -Dorg.kie.server.persistence.ds=java:jboss/datasources/jbpmDS -Dorg.kie.server.controller=http://localhost:8080/jbpm-console/rest/controller -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.persistence.dialect=org.hibernate.dialect.PostgreSQL94Dialect

And that's it.


Solution

  • it's most likely due to your server template (with id default-kieserver) does not have process capabilities. Go into Deployments -> Execution Servers and remove the template from there. Then restart the server and kie server should register with all its capabilities properly.

    Alternatively you can create server template manually with given id/name and it should be all that is needed.