gpt4 book ai didi

java - 将 db2 xa 数据源添加到 JBoss 7

转载 作者:行者123 更新时间:2023-12-02 09:31:07 25 4
gpt4 key购买 nike

我正在尝试在 JBoss 上添加 db2 xa 数据源。
JBoss 7.1,
Java 11。

这是我的standalone-full-ha.xml的一部分。

   <subsystem xmlns="urn:jboss:domain:datasources:5.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" 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>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="db2jcc" module="com.ibm">
<driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
</driver>

</drivers>
</datasources>
</subsystem>

目录结构是,standalone-modules-com-ibm-main,我添加了 jar 文件(db2jcc.jar、db2jcc_license_cu.jar、db2jcc_license_cisuz.jar)和 module.xml。
我的 module.xml 是,

<?xml version="1.0" encoding="UTF-8"?>
<module name="com.ibm" xmlns="urn:jboss:module:1.1">
<resources>
<resource-root path="db2jcc.jar"/>
<resource-root path="db2jcc_license_cu.jar"/>
<resource-root path="db2jcc_license_cisuz.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>



我试过了,
.\standalone.bat --server-config=standalone-full-ha.xml,但它根本没有改变。它不会在控制台上的Detected 选项卡上显示它。
日志文件显示,

  1  INFO  [org.jboss.as.server] (Thread-1) WFLYSRV0220: Server shutdown has been requested via an OS signal
2 [org.jboss.modcluster] (ServerService Thread Pool -- 35) MODCLUSTER000002: Initiating mod_cluster shutdown
3 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0010: Unbound data source [java:jboss/datasources/Ex ampleDS]
4 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0008: Undertow HTTPS listener https suspending
5 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0007: Undertow HTTPS listener https stopped, was bound to 127.0.0.1: 8443
6 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000080: Disconnecting JGroups channel ejb
7 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000082: Stopping the RpcDispatcher for cha nnel ejb
8 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-8) ISPN000080: Disconnecting JGroups channel ejb
9 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-1) ISPN000080: Disconnecting JGroups channel ejb
10 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-8) ISPN000082: Stopping the RpcDispatcher for cha nnel ejb
11 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-1) ISPN000082: Stopping the RpcDispatcher for cha nnel ejb
12 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000080: Disconnecting JGroups channel ejb
13 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000082: Stopping the RpcDispatcher for cha nnel ejb
14 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0019: Host default-host stopping
15 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0004: Undertow 1.4.18.Final-redhat-2 stopping
16 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = h2
17 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0028: Stopped deployment xxxxx.war (runtime-name: xxxxx.war) in 836ms
18 INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0050: JBoss EAP 7.1.0.GA (WildFly Core 3.0.10.Final-redhat-1) stopped in 844ms
19 INFO [org.jboss.modules] (main) JBoss Modules version 1.6.0.Final-redhat-1
20 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1
21 INFO [org.jboss.modules] (main) JBoss Modules version 1.6.0.Final-redhat-1
22 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1

谁能指出我做错了什么吗?

最佳答案

首先,查看官方文档: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/datasource_management#example_ibm_db2_xa_datasource其次,Java 11 仅通过 EAP 7.2 进行了测试和支持! Java 1.8 支持 EAP 7.1

关于java - 将 db2 xa 数据源添加到 JBoss 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57961603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com