Db2 Driver/Datasource setup on wildfly: Failed to load module for driver [com.ibm]

时间秒杀一切 提交于 2019-12-04 07:59:14

try replacing :

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

by

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

Remove the s from resources-route!

You could try to enable jboss.jdbc.spy = TRACE and add spy="true" to the datasource.

<datasource jndi-name="..." ... spy="true">

and

<logger category="jboss.jdbc.spy">
  <level name="TRACE"/>
</logger>

This is normally to debug the JDBC, but perhaps it shows more on the loading of the driver as well. Also you definitely need the resource-root without s.

Aleksandar Pavlovic

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.

This is not the solution to your problem but a reference for future visitors who (like me) come to this question by search of the same error message:

Today I had the same problem, for me it was an error in module.xml and standalone-full.xml. In both cases the module name was given as com.ibm.main, but it should have been com.ibm.

So in short: If you encounter this message and double checking the config files doesn't help, rewrite them.

jar files in module main folder should be added to the module.xml as

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

If you're using db2jcc.jar and not db2jcc4.jar and as you're defining a standard (non-XA) datasource, perhaps it helps to spedicfy the driver class too.

<driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!