根据JBOSS文档配置到ESB的JMS连接,定义Moudle如下:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.jboss.genericjms.provider">
<resources>
<!-- all jars required by the JMS provider, in this case webmethods -->
<resource-root path="nClient.jar"/>
<resource-root path="nJMS.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.jms.api"/>
</dependencies>
</module>
结果报告错误:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.pcbsys.foundation.base.fTimer
at com.pcbsys.foundation.logger.fLogger.<clinit>(fLogger.java:366)
at com.pcbsys.foundation.drivers.jdk.fJDKHelper.setupEnvironment(fJDKHelper.java:322)
at com.pcbsys.nirvana.client.nSessionFactory.<clinit>(nSessionFactory.java:295)
google后认为是dependencies定义问题,查看fTimer需要Java.util类定义,需要引入sun.jdk, 增加一行后正常:
<dependencies>
<module name="sun.jdk"/> <!-- must include this line, else will report:java.lang.NoClassDefFoundError: Could not initialize class com.pcbsys.foundation.base.fTimer -->
<module name="javax.api"/>
<module name="javax.jms.api"/>
</dependencies>
参考:
https://github.com/hazelcast/hazelcast/issues/4415
https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/Configure_a_Generic_JMS_Resource_Adapter_for_Use_with_a_Third-party_JMS_Provider.html