尝试使用 MySQL 数据库而不是 H2 来检索进程信息 [在 AS7 中]--jbpm-console 未部署

Trying to use MySQL Database instead of H2 to retrieve Process Info [in AS7]--jbpm-console NOT being deployed

这几天让这个工作变得非常令人沮丧。在尝试重新启动失败的流程时,我无法从保存数据的 H2 表中检索流程实例信息。我决定使用另一个我有权访问的 DBMS--MySQL.

我已经将我的程序包配置为使用 MySQL 数据库而不是默认的内存数据库来记录进程信息数据。我已经按照几个例子来了解我现在所处的位置。我使用的主要文档是

https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/#comments +
https://developer.jboss.org/wiki/DataSourceConfigurationinAS7#Installing_a_JDBC_driver_as_a_deploymentI

我有

1.) 从 dev.mysql.com 下载 MySQL 驱动程序,并在尝试让它工作几天后意识到它是 JDBC-4 兼容的,它必须是操纵以使其工作 2.) 通过在 jboss/modules/com/mysql/main:

中创建模块文件将驱动程序安装为模块
 <module xmlns="urn:jboss:module:1.0" name="com.mysql">
         <resources>
                <resource-root path="mysql-connector-java-5.1.35-bin_COMPLIANT.jar"/>
         </resources>
         <dependencies>
                 <module name="javax.api"/>
                 <module name="javax.transaction.api"/>
          </dependencies>
 </module>

3.) 在独立配置中定义了数据源 jboss/standalone/configuration/standalone-full。xml:

   <datasources>
            <datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="jbpmDS" enabled="true" use-java-context="true" use-ccm="true">
                <connection-url>jdbc:mysql://localhost:3306/jbpm6</connection-url>
                <driver>mysql</driver>
                <security>
                    <user-name>root</user-name>
                    <password>pass</password>
                </security>
            </datasource>
            <drivers>
                <driver name="mysql" module="com.mysql">
                    <driver-class>com.mysql.jdbc.Driver</driver-class>
                    <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                </driver>
            </drivers>
        </datasources>

5.) JBPM DB 也是使用 jbpm-installer/db/ddl-scripts/mysql 中提供的脚本创建的。所有持久性表似乎都在那里。

我正在使用 . jboss/bin/standalone.sh --server-config=standalone-full.xml&

此安装未成功,我认为此(重复出现的)异常阻止我的 jbpm-console 启动: 11:52:46,592 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-12) HHH000319: Could not get database metadata: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'sequences' in information_schema at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_60] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_60] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_60] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_60] at com.mysql.jdbc.Util.handleNewInstance(Util.java:389) at com.mysql.jdbc.Util.getInstance(Util.java:372) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2531) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2489) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446) at org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:340) at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:149) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.tool.hbm2ddl.DatabaseMetadata.(DatabaseMetadata.java:70) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.tool.hbm2ddl.DatabaseMetadata.(DatabaseMetadata.java:63) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:196) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:457) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:84) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

您发布的链接仅帮助您设置数据源,但您还需要将休眠的持久性配置从 H2 更改为 MySQL。

官方 jbpm 文档有一个部分是这样的: http://docs.jboss.org/jbpm/v6.2/userguide/jBPMInstaller.html#d0e950