Db2驱动程序/数据源设置在wildfly:驱动程序[com.ibm]加载模块失败 [英] Db2 Driver/Datasource setup on wildfly: Failed to load module for driver [com.ibm]
问题描述
我想在我的wildfly服务器(Wildfly.8.0.0-Final和8.1.0)上配置db2的数据源,并且遇到了一些问题。
我的研究告诉我,这是一个两步的过程。
- 将驱动程序作为模块安装在%JBOSS_HOME% / modules / com / ibm / main dir。
- 配置数据源子系统,将此模块作为连接设置中的驱动程序。
到目前为止,我已经使用以下模块将模块安装在以下模块中:
modules /
` - com /
` - ibm /
` - main /
| - db2jcc4.jar
| - db2jcc_license_cu。 jar
| - db2jcc_license_cisuz.jar
` - module.xml
<?xml version =1.0encoding =UTF-8?>
< module xmlns =urn:jboss:module:1.3name =com.ibm>
< resources>
< resource-root path =db2jcc4.jar/>
< resource-root path =db2jcc_license_cu.jar/>
< resource-root path =db2jcc_license_cisuz.jar/>
< / resources>
<依赖关系>
< module name =javax.api/>
< module name =javax.transaction.api/>
< module name =sun.jdk/>
< / dependencies>
< / module>
<?...?>之前没有空格
在xml文件中。模块名称为com.ibm,数据源如下:
< subsystem xmlns =urn:jboss: domain:datasources:2.0>
< datasources>
< datasource jndi-name =java:/ jdbc / MyDSpool-name =MyDSenabled =trueuse-java-context =true>
< xa-datasource-property name =ServerName> myIP< / xa-datasource-property>
< xa-datasource-property name =PortNumber> 1234< / xa-datasource-property>
< xa-datasource-property name =DatabaseName> MyDB< / xa-datasource-property>
< xa-datasource-property name =DriverType> 4< / xa-datasource-property>
< driver> ibmdb2< / driver>
< pool>
< min-pool-size> 0< / min-pool-size>
< max-pool-size> 50< / max-pool-size>
< / pool>
< security>
< user-name> bob< / user-name>
< password> isyouruncle< / password>
< / security>
< validation>
< valid-connection-checker class-name =org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker/>
< stale-connection-checker class-name =org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker/>
< exception-sorter class-name =org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter/>
< / validation>
< / datasource>
< drivers>
< driver name =ibmdb2module =com.ibm>
< xa-datasource-class> com.ibm.db2.jcc.DB2XADatasource< / xa-datasource-class>
< / driver>
< / drivers>
< / datasources>
< / subsystem>
加载服务器会导致此错误:
12:49:01,228 ERROR [org.jboss.as.controller.management-operation](ServerService线程池 - 9)JBAS014613:操作(添加)失败 - 地址:()
(子系统=>数据源)
(jdbc-driver=>ibmdb2)
]) - 故障描述:JBAS010441:无法加载驱动程序的模块[com.ibm]
这又导致我的数据源声明失败
我正在使用旧文档作为指南,因为还没有似乎没有可用的野猫。 此文档显示了一些承诺,但似乎有点过时。如果任何人有任何经验设置,那么您的帮助将不胜感激。
我想连接到 DB2 9.7 。 >
请谢谢。
我有同样的问题。我通过从module.xml中删除这两行来解决它:
< resource-root path =db2jcc_license_cu.jar/ >
< resource-root path =db2jcc_license_cisuz.jar/>
我没有一个具体的解释,为什么这个工作。
I am wanting to configure the data source for db2 on my wildfly server (Wildfly.8.0.0-Final and 8.1.0 as well.) and am running into some problems doing so.
My research tells me this is a two step process
- install the drivers as a module in the %JBOSS_HOME%/modules/com/ibm/main dir.
- configure the datasources subsystem to include this module as a driver in your connection settings.
So far I have installed the module under the following structure with the following module.xml:
modules/
`-- com/
`-- ibm/
`-- main/
|-- db2jcc4.jar
|-- db2jcc_license_cu.jar
|-- db2jcc_license_cisuz.jar
`-- module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.ibm">
<resources>
<resource-root path="db2jcc4.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"/>
<module name="sun.jdk"/>
</dependencies>
</module>
There is no space before the <?...?>
in the xml file. the module name is "com.ibm" and the datasource is as follows:
<subsystem xmlns="urn:jboss:domain:datasources:2.0">
<datasources>
<datasource jndi-name="java:/jdbc/MyDS" pool-name="MyDS" enabled="true" use-java-context="true">
<xa-datasource-property name="ServerName">myIP</xa-datasource-property>
<xa-datasource-property name="PortNumber">1234</xa-datasource-property>
<xa-datasource-property name="DatabaseName">MyDB</xa-datasource-property>
<xa-datasource-property name="DriverType">4</xa-datasource-property>
<driver>ibmdb2</driver>
<pool>
<min-pool-size>0</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<user-name>bob</user-name>
<password>isyouruncle</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="ibmdb2" module="com.ibm">
<xa-datasource-class>com.ibm.db2.jcc.DB2XADatasource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
The loading up of the server produces this error:
12:49:01,228 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 9) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "ibmdb2")
]) - failure description: "JBAS010441: Failed to load module for driver [com.ibm]"
Which in turn causes my datasource declaration to fail loading as the driver is missing.
I am using older documentation as a guide because there doesn't seem to be any available for wildfly as yet. this documentation shows some promise but it seems a little out of date. If anyone has had any experience setting this up then Your help would be much appreciated.
I want to connect to DB2 9.7.
Please and thank you.
I had the same issue. I resolved it by removing these two lines from module.xml:
<resource-root path="db2jcc_license_cu.jar"/>
<resource-root path="db2jcc_license_cisuz.jar"/>
I don't have a specific explanation as to why this worked.
这篇关于Db2驱动程序/数据源设置在wildfly:驱动程序[com.ibm]加载模块失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!