Dockerized jBPM with DB2 Fails Upon Docker Restart

huangapple go评论75阅读模式
英文:

Dockerized jBPM with DB2 Fails Upon Docker Restart

问题

这是您提供的问题的翻译:

Docker化的jBPM在Docker重新启动时与DB2失败

你好,Stack Overflow社区,

我遇到了一个问题,我的Docker容器正在运行jBPM与DB2数据库。问题出现在我尝试重新启动Docker容器时。

当我首次启动Docker服务时,一切正常。DB2数据库创建了所有的jBPM表,我可以通过localhost:8080/business-central浏览而没有任何问题。

然而,当我随后重新启动(停止/启动)jBPM服务器容器时,我遇到了问题。下面显示的错误消息出现在日志中,并停止了显示“流程定义”的选项。

我已经使用Postgres作为数据库进行了相同的测试,结果都是正确的,无论是在容器首次启动后还是在重新启动后。我明白这必须是一个配置问题,但我已经多次检查了参数,但仍然无法找出问题所在。

以下是日志中出现的错误消息:

2023-05-25 16:05:25,905 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) Error accessing table metadata [n/a]: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
(以下为更多日志信息)

这是我的docker-compose.yml文件的内容:

(贴出了docker-compose.yml的内容)

这是com.ibm目录下的module.xml文件的内容:

(贴出了module.xml文件的内容)

最后,这是生成的standalone.xml文件中的数据源内容:

(贴出了standalone.xml文件中的数据源内容)

我正在尝试模拟一个情景,其中DB2数据库已经存在并且已经创建了jBPM数据库模型。

第一步是启动容器,以便在启动时自动创建DB2中的模型(jBPM会在启动时自动执行此操作)。

接下来的步骤是验证通过重新启动jBPM服务器容器,系统是否继续正常运行。在这一步中,我遇到了错误

最后的测试是删除已使用的Docker容器并创建一个新容器,它应该能够找到已经创建的数据库并正常运行。

我已经尝试了多种解决方案来解决这个问题,但迄今为止都没有成功。

谁能提供关于可能导致这个问题的见解以及如何解决它的建议吗?

非常感谢您的帮助。

英文:

Dockerized jBPM with DB2 Fails Upon Docker Restart

Hello Stack Overflow Community,

I've encountered an issue with my Docker container that's running jBPM with a DB2 database. The issue arises specifically when I try to restart the Docker container.

When I start the Docker services for the first time, everything works correctly. The DB2 database creates all of the jBPM tables and I can navigate through localhost:8080/business-central without any issues.

However, when I subsequently restart (stop/start) the jBPM-server container, I encounter a problem. The error message shown below appears in the logs and the option to display "process definition" stops functioning.

I have conducted the same tests using Postgres as the database, and the results were correct, both the first time the container is started and after a restart. I understand that it must be a configuration issue, but I have reviewed the parameters several times and have not been able to figure out where the problem lies.

Here is the error message that appears in the logs:

2023-05-25 16:05:25,905 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) Error accessing table metadata [n/a]: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:794)
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:66)
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:116)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.java:4892)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:407)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:386)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResults(InformationExtractorJdbcDatabaseMetaDataImpl.java:483)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:463)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:215)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTableInformation(DatabaseInformationImpl.java:111)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.locateTableInformation(DatabaseInformationImpl.java:148)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:821)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:97)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKeys(TableInformationImpl.java:91)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.checkForExistingForeignKey(AbstractSchemaMigrator.java:471)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applyForeignKeys(AbstractSchemaMigrator.java:423)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:249)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
at deployment.kie-server.war//org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
at deployment.kie-server.war//org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
at deployment.kie-server.war//org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.createEntityManagerFactory(JbpmKieServerExtension.java:830)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:823)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.configureServices(JbpmKieServerExtension.java:239)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.init(JbpmKieServerExtension.java:195)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:184)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:142)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator$KieServerLocatorHelper.<clinit>(KieServerLocator.java:25)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator.getInstance(KieServerLocator.java:32)
at deployment.kie-server.war//org.kie.server.remote.rest.common.Bootstrap.contextInitialized(Bootstrap.java:51)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
2023-05-25 16:05:25,917 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) SQL Error: -4470, SQLState: null
2023-05-25 16:05:25,917 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
2023-05-25 16:05:25,919 DEBUG [org.hibernate.internal.SessionFactoryImpl] (ServerService Thread Pool -- 79) HHH000031: Closing
2023-05-25 16:05:25,920 DEBUG [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 79) Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@5d935bc
2023-05-25 16:05:25,920 DEBUG [org.hibernate.type.spi.TypeConfiguration$Scope] (ServerService Thread Pool -- 79) Un-scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration$Scope@4c53c80d] from SessionFactory [org.hibernate.internal.SessionFactoryImpl@1be0a099]
2023-05-25 16:05:25,921 DEBUG [org.hibernate.service.internal.AbstractServiceRegistryImpl] (ServerService Thread Pool -- 79) Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries
2023-05-25 16:05:25,921 DEBUG [org.hibernate.boot.registry.internal.BootstrapServiceRegistryImpl] (ServerService Thread Pool -- 79) Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries
2023-05-25 16:05:25,921 ERROR [org.kie.server.services.impl.KieServerImpl] (ServerService Thread Pool -- 79) Error when initializing server extension of type jBPM KIE Server extension: java.lang.RuntimeException: Unable to create EntityManagerFactory due to [PersistenceUnit: org.jbpm.domain] Unable to build Hibernate SessionFactory
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:825)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.configureServices(JbpmKieServerExtension.java:239)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.init(JbpmKieServerExtension.java:195)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:184)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:142)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator$KieServerLocatorHelper.<clinit>(KieServerLocator.java:25)
at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator.getInstance(KieServerLocator.java:32)
at deployment.kie-server.war//org.kie.server.remote.rest.common.Bootstrap.contextInitialized(Bootstrap.java:51)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build Hibernate SessionFactory
at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1327)
at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1253)
at deployment.kie-server.war//org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.createEntityManagerFactory(JbpmKieServerExtension.java:830)
at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:823)
... 27 more
Caused by: org.hibernate.exception.GenericJDBCException: Error accessing table metadata
at deployment.kie-server.war//org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at deployment.kie-server.war//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at deployment.kie-server.war//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:98)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:471)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:215)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTableInformation(DatabaseInformationImpl.java:111)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.locateTableInformation(DatabaseInformationImpl.java:148)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:821)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:97)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKeys(TableInformationImpl.java:91)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.checkForExistingForeignKey(AbstractSchemaMigrator.java:471)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applyForeignKeys(AbstractSchemaMigrator.java:423)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:249)
at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
at deployment.kie-server.war//org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
at deployment.kie-server.war//org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
... 30 more
Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:794)
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:66)
at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:116)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.java:4892)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:407)
at com.ibm//com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:386)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResults(InformationExtractorJdbcDatabaseMetaDataImpl.java:483)
at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:463)
... 45 more

Here is the content of my docker-compose.yml file:

version: '3'
services:
  jbpm-server:
    image: quay.io/kiegroup/jbpm-server-full:7.73.0.Final
    ports:
      - "8001:8001"
      - "8080:8080"
    environment:
      - JBPM_DB_DRIVER=db2
      - JBPM_DB_HOST=db2server
      - JBPM_DB_PORT=50000
      - JBPM_DB_NAME=jbpm
      - JBPM_DB_USER=jbpm
      - JBPM_DB_PASSWORD=password
    volumes:
      - ./configuration/jbpm-db2-config_xa_datasource.cli:/opt/jboss/wildfly/bin/jbpm-db2-config.cli
      - ./drivers/db2jcc4.jar:/opt/jboss/wildfly/bin/drivers/db2jcc4.jar
      
    depends_on:
      - db2server

  db2server:
    image: icr.io/db2_community/db2:11.5.8.0
    hostname: db2server
    privileged: true
    ports:
      - "50000:50000"
    environment:
      - LICENSE=accept
      - DB2INSTANCE=jbpm
      - DB2INST1_PASSWORD=password
      - DBNAME=jbpm
      - BLU=false
      - ENABLE_ORACLE_COMPATIBILITY=false
      - UPDATEAVAIL=NO
      - TO_CREATE_SAMPLEDB=false
      - REPODB=false
      - IS_OSXFS=false
      - PERSISTENT_HOME=true
      - HADR_ENABLED=false
      - ETCD_ENDPOINT=
      - ETCD_USERNAME=
      - ETCD_PASSWORD=

This is the content of my module.xml file under the com.ibm directory:

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

<module xmlns="urn:jboss:module:1.1" name="com.ibm">

    <resources>
        <resource-root path="db2jcc4.jar"/>
    </resources>

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

Finally, here are the datasources from the standalone.xml file that gets generated:

...
                <xa-datasource jndi-name="java:jboss/datasources/jBPMDS" pool-name="jBPMXADS">
                    <xa-datasource-property name="ServerName">
                        db2server
                    </xa-datasource-property>
                    <xa-datasource-property name="DatabaseName">
                        jbpm
                    </xa-datasource-property>
                    <xa-datasource-property name="PortNumber">
                        50000
                    </xa-datasource-property>
                    <xa-datasource-property name="DriverType">
                        4
                    </xa-datasource-property>
                    <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
                    <driver>db2</driver>
                    <xa-pool>
                        <is-same-rm-override>false</is-same-rm-override>
                    </xa-pool>
                    <security>
                        <user-name>jbpm</user-name>
                        <password>password</password>
                    </security>
                    <recovery>
                        <recover-plugin class-name="org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin">
                            <config-property name="EnableIsValid">
                                false
                            </config-property>
                            <config-property name="IsValidOverride">
                                false
                            </config-property>
                            <config-property name="EnableClose">
                                false
                            </config-property>
                        </recover-plugin>
                    </recovery>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
                        <validate-on-match>true</validate-on-match>
                        <background-validation>true</background-validation>
                        <background-validation-millis>120000</background-validation-millis>
                        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
                    </validation>
                </xa-datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                    <driver name="db2" module="com.ibm">
                        <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
                    </driver>
                </drivers>                
...

I'm trying to simulate a scenario where the DB2 database already exists and has the jBPM database model created.

The first step is to start the containers so that the model in DB2 is created (jBPM does this automatically at startup).

The next step is to verify that by restarting the jBPM-server container, the system continues to function. At this step is where I encountered the error.

Finally, the ultimate test would be to remove the used Docker container and create a new one, which should find the already created database and run correctly.

I've tried several solutions to resolve this issue but none of them have worked so far.

Can anyone provide any insight into what might be causing this issue and how I can resolve it?

Thank you in advance for your help.

答案1

得分: 0

问题似乎是由于针对早于jcc4的db2 jcc驱动程序设计的代码而产生的。当请求对已关闭的结果集进行下一操作时,会抛出异常。

您可以将此参数设置为数据源:

allowNextOnExhaustedResultSet=1

希望对您有帮助!

英文:

the problem seems to be produced for code that is designed for db2 jcc driver prior to jcc4. When a next operation is requested to a closed resulset the exception is throwed.

You can set this parameter to the datasorce:

allowNextOnExhaustedResultSet=1

Hope this helps!!!

huangapple
  • 本文由 发表于 2023年5月26日 00:36:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76334503.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定