带有WebSphere MQ 9的WildFly 10:onMessage MDB部署错误 在Jboss EAP 7.0.6 GA、IBM MQ 9上,我有一个用于消费队列消息的MDB 包com.ryzorbent.demo.jms; 导入javax.ejb.ActivationConfigProperty; 导入javax.ejb.MessageDriven; 导入javax.ejb.TransactionAttribute; 导入javax.jms.jmsception; 导入javax.jms.Message; 导入javax.jms.MessageListener; 导入javax.jms.TextMessage; 导入org.jboss.ejb3.annotation.ResourceAdapter; @MessageDriven(name=“EFRSTestMDB”,activationConfig={ @ActivationConfigProperty(propertyName=“destinationType”,propertyValue=“javax.jms.Queue”), @ActivationConfigProperty(propertyName=“useJNDI”,propertyValue=“false”), @ActivationConfigProperty(propertyName=“hostName”,propertyValue=“localhost”), @ActivationConfigProperty(propertyName=“port”,propertyValue=“1414”), @ActivationConfigProperty(propertyName=“channel”,propertyValue=“SYSTEM.DEF.SVRCONN”), @ActivationConfigProperty(propertyName=“queueManager”,propertyValue=“EFRS_UAT”), @ActivationConfigProperty(propertyName=“destination”,propertyValue=“jms/queue/queue”), @ActivationConfigProperty(propertyName=“transportType”,propertyValue=“CLIENT”) }) @ResourceAdapter(value=“wmq.jmsra.rar”) //@交易属性(value=“nottransaction”) 公共类efrstmdb实现MessageListener{ @凌驾 消息上的公共无效(消息中的消息){ TextMessage=(TextMessage)inMessage; 试一试{ System.out.println(String.format(“Hello,%s”,message.getText()); }捕获(JME){ e、 printStackTrace(); } } } 我将wmq.jmsra.rar复制到../standalone/deployments中 将队列、通道等的资源适配器子系统添加到standalone-full.xml中 但是我得到了下面的错误 java.lang.NoClassDefFoundError:未能链接com/ryzorbent/demo/jms/EFRSTestMDB(服务模块加载器中的模块“deployment.TestJbossMDB.jar:main”):javax/jms/MessageListener

带有WebSphere MQ 9的WildFly 10:onMessage MDB部署错误 在Jboss EAP 7.0.6 GA、IBM MQ 9上,我有一个用于消费队列消息的MDB 包com.ryzorbent.demo.jms; 导入javax.ejb.ActivationConfigProperty; 导入javax.ejb.MessageDriven; 导入javax.ejb.TransactionAttribute; 导入javax.jms.jmsception; 导入javax.jms.Message; 导入javax.jms.MessageListener; 导入javax.jms.TextMessage; 导入org.jboss.ejb3.annotation.ResourceAdapter; @MessageDriven(name=“EFRSTestMDB”,activationConfig={ @ActivationConfigProperty(propertyName=“destinationType”,propertyValue=“javax.jms.Queue”), @ActivationConfigProperty(propertyName=“useJNDI”,propertyValue=“false”), @ActivationConfigProperty(propertyName=“hostName”,propertyValue=“localhost”), @ActivationConfigProperty(propertyName=“port”,propertyValue=“1414”), @ActivationConfigProperty(propertyName=“channel”,propertyValue=“SYSTEM.DEF.SVRCONN”), @ActivationConfigProperty(propertyName=“queueManager”,propertyValue=“EFRS_UAT”), @ActivationConfigProperty(propertyName=“destination”,propertyValue=“jms/queue/queue”), @ActivationConfigProperty(propertyName=“transportType”,propertyValue=“CLIENT”) }) @ResourceAdapter(value=“wmq.jmsra.rar”) //@交易属性(value=“nottransaction”) 公共类efrstmdb实现MessageListener{ @凌驾 消息上的公共无效(消息中的消息){ TextMessage=(TextMessage)inMessage; 试一试{ System.out.println(String.format(“Hello,%s”,message.getText()); }捕获(JME){ e、 printStackTrace(); } } } 我将wmq.jmsra.rar复制到../standalone/deployments中 将队列、通道等的资源适配器子系统添加到standalone-full.xml中 但是我得到了下面的错误 java.lang.NoClassDefFoundError:未能链接com/ryzorbent/demo/jms/EFRSTestMDB(服务模块加载器中的模块“deployment.TestJbossMDB.jar:main”):javax/jms/MessageListener,java,ibm-mq,wildfly-10,Java,Ibm Mq,Wildfly 10,wmq.jmsra.rar不包含您的错误中的jmsapi类,如javax/JMS/MessageListener。信中说: IBM WebSphere®MQ 7.5资源适配器的部署不会为您的部署加载javax.jms.api模块。它也不支持新的javeee7注释,如@JMSConnectionFactoryDefinitions、@JMSDestinationDefinition。有必要在配置中设置消息传递activemq子系统以启用它。如果不希望启动JBoss EAP消息传递服务器,请添加一个

wmq.jmsra.rar
不包含您的错误中的jmsapi类,如
javax/JMS/MessageListener
。信中说:

IBM WebSphere®MQ 7.5资源适配器的部署不会为您的部署加载javax.jms.api模块。它也不支持新的javeee7注释,如@JMSConnectionFactoryDefinitions、@JMSDestinationDefinition。有必要在配置中设置消息传递activemq子系统以启用它。如果不希望启动JBoss EAP消息传递服务器,请添加一个空的消息传递activemq子系统


因此,您必须添加JMS api JAR以及上述内容。

h使用IBM MQ消息传递时,始终从“完整”服务器配置文件(如standalone-full.xml)开始。“完整”配置文件包括JMS消息传递

作为补充说明,我看到您的激活规范有:

        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/QUEUE"),
所以,您必须将JNDI设置为false,但您的目的地看起来确实像一个JNDI名称。当useJNDI设置为false时,目标名称是IBM MQ端的队列名称-通常在所有CAP中,很像您的队列管理器和通道。

我在standalone-full.xml文件中添加了
,但是**Messaging-ActiveMQ**没有出现在subsystem>下,我使用的是IBM MQ版本8的
wmq.jmsra.rar
,在“必需扩展名”一章中,写了如何获取此子系统。是你干的吗? java.lang.NoClassDefFoundError: Failed to link com/ryzorbent/demo/jms/EFRSTestMDB (Module "deployment.TestJbossMDB.jar:main" from Service Module Loader): javax/jms/MessageListener
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/QUEUE"),