1

我正在努力更改 JBoss BRMS 6.4 的默认 H2 数据源以使用 PostgreSQL JDBC 驱动程序。我使用 JBoss EAP 6.4 作为 JBoss BRMS 6.4 的容器。我的 postgresql 驱动程序的名称是:postgresql-9.4-1202.jdbc42.jar 对于新数据库,我安装了 Postgresql 并创建了一个角色和一个数据库,我将其命名为 jbpm。然后我下载了 jboss-brms-bpmsuite-6.4-supplementary-tools/ddl-scripts 用于导入postgresql-jbpm-schema.sql

以下是我尝试使其工作的方式。

1- 我在standalone.xml 文件中添加了一些新行,以使 JBoss 使用 PostgresSQL 作为数据源:

<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>

<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://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>

2-这是我在此路径 /EAP_HOME/modules/org/postgres/main/module.xml 中创建的 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>

3-为了注册业务中心,我还通过添加以下行来配置 persistence.xml:

<jta-data-source>java:jboss/datasources/PostgresqlDS</jta-
data-source>
<property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect" />

4 - 但是当我执行 ./standalone.sh 脚本时,我收到此错误:

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"]

谢谢你的时间和帮助我,特别是你的时间。

4

1 回答 1

0

这个问题详细解释了该过程: jBPM 7.3.0 persistence with Postgres 9.6

我知道它是不同的版本,但它仍然适用于您的情况。

所以正确的步骤是:

  • SET wildfly-10.1.0.Final\modules\org\postgresql\main\module.xml
  • 更改standalone-full.xml
  • 在 jbpm 数据库上运行 ddl 脚本,使用 jbpm 模式和用户(如果需要)
  • 使用适当的开关启动服务器,最重要的新开关

Dorg.kie.server.persistence.ds=java:jboss/datasources/jbpmDS Dorg.kie.server.persistence.dialect=org.hibernate.dialect.PostgreSQL94Dialect

于 2019-07-11T16:13:55.873 回答