6 Replies Latest reply on May 30, 2017 9:15 AM by Anup Dey

    Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource

    Jules HOUANTONON Newbie

      Hello all,

      I am trying to configure JBoss BRMS 6.4 to use PostgreSQL as datasource. JBoss BRMS 6.4  is using JBoss EAP  6.4 as container.

       

      I am using postgresql-9.4-1202.jdbc42.jar as JDBC driver. My operating system is Centos 7

       

      The  part in bold are  the lines that I add in the standalone.xml file to make JBoss use PostgresSQL as datasource :

       

      I add this two lines in the system-properties

      <system-properties>

              <property name="org.kie.example" value="true"/>

              <property name="org.jbpm.designer.perspective" value="ruleflow"/>

              <property name="designerdataobjects" value="false"/>

              <property name="org.jbpm.server.ext.disabled" value="true"/>

              <property name="org.jbpm.ui.server.ext.disabled" value="true"/>

              <property name="org.uberfire.nio.git.daemon.host" value="0.0.0.0"/>

              <property name="org.uberfire.nio.git.ssh.host" value="0.0.0.0"/>

              <property name="org.kie.server.location" value="http://orc-brms3:8080/kie-server/services/rest/server"/>

              <property name="org.kie.server.controller" value="http://orc-brms3:8080/business-central/rest/controller"/>

              <property name="org.kie.server.controller.user" value="brms"/>

              <property name="org.kie.server.controller.pwd" value="P@ssw0rd"/>

              <property name="org.kie.server.user" value="brms"/>

              <property name="org.kie.server.pwd" value="P@ssw0rd"/>

              <property name="org.kie.server.id" value="default-kieserver"/>

              <property name="jboss.as.management.blocking.timeout" value="700"/>

              <property name="org.kie.server.persistence.ds" value="java:jboss/datasources/PostgresqlDS"/>

              <property name="org.kie.server.persistence.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

          </system-properties>

       

       

                <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="false" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="PostgresqlDS" enabled="true">

                          <connection-url>jdbc:postgresql://192.168.56.16:5432/jbpm</connection-url>

                          <driver>postgresql-9.4-1202.jdbc42.jar</driver>

                            <security>

                              <user-name>jbpm</user-name>

                              <password>jbpm</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                           <driver name="postgres" module="org.postgres">

                             <driver-class>org.postgresql.Driver</driver-class>

                          </driver>

                      </drivers>

                  </datasources>

       

      This is the content of my module.xml that i creat in : /EAP_HOME/modules/org/postgres/main/module.xml

      <?xml version="1.0" ?>

      <module xmlns="urn:jboss:module:1.1" name="org.postgres">

        <resources>

            <resource-root path="postgresql-9.4-1202.jdbc42.jar"/>

        </resources>

        <dependencies>

           <module name="javax.api"/>

           <module name="javax.transaction.api"/>

        </dependencies>

      </module>

       

      But when I execute the ./standalone.sh script I receive this Error :

       

      00:28:36,709 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([

          ("subsystem" => "datasources"),

          ("data-source" => "PostgresqlDS")

      ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [

          "jboss.data-source.java:jboss/datasources/PostgresqlDS is missing [jboss.jdbc-driver.postgresql-9_4-1202_jdbc42_jar]",

          "jboss.driver-demander.java:jboss/datasources/PostgresqlDS is missing [jboss.jdbc-driver.postgresql-9_4-1202_jdbc42_jar]"

      ]}

      00:28:36,711 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("enable") failed - address: ([

          ("subsystem" => "datasources"),

          ("data-source" => "PostgresqlDS")

      ]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {

          "Services that were unable to start:" => [

              "jboss.data-source.reference-factory.PostgresqlDS",

              "jboss.naming.context.java.jboss.datasources.PostgresqlDS"

          ],

          "Services that may be the cause:" => ["jboss.jdbc-driver.postgresql-9_4-1202_jdbc42_jar"]

       

      Thank you for your time and helping me.

       

      So please if you think that I am are the wrong place for expecting solution, kindly indicate the correct forum.

        • 1. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
          Anup Dey Expert

          The example below is a PostgreSQL datasource configuration:

           

          <datasources>

            <datasource jndi-name="java:jboss/PostgresDS" pool-name="PostgresDS">

            <connection-url>jdbc:postgresql://localhost:5432/postgresdb</connection-url>

            <driver>postgresql</driver>

            <security>

            <user-name>admin</user-name>

            <password>admin</password>

            </security>

            <validation>

            <validate-on-match>true</validate-on-match>

            <background-validation>false</background-validation>

            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"></valid-connection-checker>

            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"></exception-sorter>

            </validation>

            </datasource>

            <drivers>

            <driver name="postgresql" module="org.postgresql">

            <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>

            </driver>

            </drivers>

          </datasources>

          The example below is a PostgreSQL datasource configuration:

           

          <module xmlns="urn:jboss:module:1.1" name="org.postgresql">

            <resources>

            <resource-root path="postgresql-9.1-902.jdbc4.jar"/>

            </resources>

            <dependencies>

            <module name="javax.api"/>

            <module name="javax.transaction.api"/>

            </dependencies>

          </module>

          Try this..

          • 2. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
            Wolf-Dieter Fink Master

            You've added the driver as jar file in your DS configuration, but this is for deploying it.

            As you have a driver definition in your config you should use the reference <driver>postgres</driver> as shown in the H2 configuation

            • 3. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
              Jules HOUANTONON Newbie

              Hello Anup Dey,

               

              I try new configuration with your files, but still having the same errors.

               

              Thank you for helping and for your time.

               

              I will paste my configuration files. I am surely missing something

              • 4. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
                Jules HOUANTONON Newbie

                Hello Wdfink,

                thank you for your answer.

                I make the changes as you said, and still having this error :

                 

                19:37:14,109 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([

                    ("subsystem" => "datasources"),

                    ("data-source" => "PostgresqlDS")

                ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [

                    "jboss.data-source.java:jboss/datasources/PostgresqlDS is missing [jboss.jdbc-driver.postgres]",

                    "jboss.driver-demander.java:jboss/datasources/PostgresqlDS is missing [jboss.jdbc-driver.postgres]"

                ]}

                19:37:14,111 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("enable") failed - address: ([

                    ("subsystem" => "datasources"),

                    ("data-source" => "PostgresqlDS")

                ]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {

                    "Services that were unable to start:" => [

                        "jboss.data-source.reference-factory.PostgresqlDS",

                        "jboss.naming.context.java.jboss.datasources.PostgresqlDS"

                    ],

                    "Services that may be the cause:" => ["jboss.jdbc-driver.postgres"]

                }}

                19:37:14,176 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

                JBAS014775:    New missing/unsatisfied dependencies:

                      service jboss.jdbc-driver.postgres (missing) dependents: [service jboss.data-source.java:jboss/datasources/PostgresqlDS, service jboss.driver-demander.java:jboss/datasources/PostgresqlDS]

                 

                THank you for helping

                • 5. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
                  Jules HOUANTONON Newbie

                  I am posting my setup , i am sure that I am missing something, but what ? I don't realy know even after reading a lot of differents pages on internet.

                   

                  standalone.xml :

                   

                  <system-properties>

                          <property name="org.kie.example" value="true"/>

                          <property name="org.jbpm.designer.perspective" value="ruleflow"/>

                          <property name="designerdataobjects" value="false"/>

                          <property name="org.jbpm.server.ext.disabled" value="true"/>

                          <property name="org.jbpm.ui.server.ext.disabled" value="true"/>

                          <property name="org.uberfire.nio.git.daemon.host" value="0.0.0.0"/>

                          <property name="org.uberfire.nio.git.ssh.host" value="0.0.0.0"/>

                          <property name="org.kie.server.location" value="http://orc-brms4:8080/kie-server/services/rest/server"/>

                          <property name="org.kie.server.controller" value="http://orc-brms4:8080/business-central/rest/controller"/>

                          <property name="org.kie.server.controller.user" value="brms"/>

                          <property name="org.kie.server.controller.pwd" value="P@ssw0rd"/>

                          <property name="org.kie.server.user" value="brms"/>

                          <property name="org.kie.server.pwd" value="P@ssw0rd"/>

                          <property name="org.kie.server.id" value="default-kieserver"/>

                          <property name="jboss.as.management.blocking.timeout" value="700"/>

                          <property name="org.kie.server.persistence.ds" value="java:jboss/datasources/PostgresqlDS"/>

                          <property name="org.kie.server.persistence.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

                      </system-properties>

                   

                  <subsystem xmlns="urn:jboss:domain:datasources:1.2">

                              <datasources>

                                  <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="false" use-java-context="true">

                                      <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                                      <driver>h2</driver>

                                      <security>

                                          <user-name>sa</user-name>

                                          <password>sa</password>

                                      </security>

                                  </datasource>

                                  <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="PostgresqlDS" enabled="true">

                                      <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url>

                                      <driver>postgres</driver>

                                       <security>

                                          <user-name>jbpm</user-name>

                                          <password>jbpm</password>

                                      </security>

                                  </datasource>

                                  <drivers>

                                      <driver name="h2" module="com.h2database.h2">

                                          <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                                      </driver>

                                      <driver name="postgres" module="org.postgres">

                                          <driver-class>org.postgresql.Driver</driver-class>

                                      </driver>

                                  </drivers>

                              </datasources>

                          </subsystem>

                   

                   

                  The content of module.xml in /var/lib/jboss-brms-6.4-/modules/org/postgres/main

                   

                  <?xml version="1.0" encoding="UTF-8"?>

                  <module xmlns="urn:jboss:module:1.1" name="org.postgres">

                      <resources>

                          <resource-root path="postgresql-9.4-1206.jdbc42.jar"/>

                      </resources>

                      <dependencies>

                          <module name="javax.api"/>

                          <module name="javax.transaction.api"/>

                      </dependencies>

                  </module>

                   

                  I have also the jar file postgresql-9.4-1206-jdbc42.jar in the main folder.

                   

                  Thank you again for your time and helping.

                  • 6. Re: Impossible to Configure JBoss 6.4 with PostgreSQL as Datasource
                    Anup Dey Expert

                    Have you tried the details configuration posted by Anup Dey dated on May 26, 2017 ?