我在Jboss EAP 6.1中遇到与WebSphere MQ接收消息的问题。
我按照redhat指南Deploy the WebSphere MQ Resource Adapter在Jboss EAP中配置了WebSphere MQ,但在服务器收到消息时我得到了
ERROR [org.jboss.as.ejb3.invocation] (default-threads - 1) JBAS014134: EJB Invocation failed on component QueueClass_MDB_IDM_REQ for method public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message): javax.ejb.EJBException: JBAS014580: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:188) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:237) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:299) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
...
Caused by: java.lang.ClassNotFoundException: com.ibm.mq.MQException from [Module "deployment.abc-ear.ear.cnt-abc-integration.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.2.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.2.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.2.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.2.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.2.Final-redhat-1]
... 68 more
似乎我的班级找不到wmq课程,我将wmq.jms.rar复制到standalone / deployments文件夹并正确配置了资源适配器:
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl"
jndi-name="java:jboss/MQ.CONNECTIONFACTORY.NAME"
pool-name="MQ.CONNECTIONFACTORY.NAME">
<config-property name="channel">
MQ.CHANNEL.NAME
</config-property>
<config-property name="transportType">
MQ.CLIENT
</config-property>
<config-property name="queueManager">
MQ.QUEUE.MANAGER
</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object
class-name="com.ibm.mq.connector.outbound.MQQueueProxy"
jndi-name="java:jboss/MQ.QUEUE.NAME"
pool-name="MQ.QUEUE.NAME">
<config-property name="baseQueueName">
MQ.QUEUE.NAME
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>