我需要将 WebSphere MQ7 队列(在队列管理器 QMA 中说 queA)映射到 EJB3 MDB。
我使用创建 MQ 队列管理器和队列
crtmqm QMA
并使用它启动它strmqm MQA
然后我写了一个文件文件名QMA.conf
并包含
DEFINE QLOCAL ('queA')
它并运行命令
runmqsc QMA < QMA.conf
然后我运行
strmqcsv MQA &
runmqlsr -m QMA -t TCP &
所有这些步骤作为 mqm 登录用户完成。
然后我按照 http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ 链接配置 RAR 到 jboss 5.1。当我运行也成功的测试连接时。
在那里我包括
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
在我的 MDB 中,我包括
@MessageDriven( name="WMQMDBTest",
activationConfig =
{
@ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
@ActivationConfigProperty(propertyName = "username", propertyValue = "mqm"),
@ActivationConfigProperty(propertyName = "password", propertyValue = "password")
})
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@ResourceAdapter(value = "wmq.jmsra.rar")
当我尝试部署 bean 时,它说
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar,
name=WMQMDBTest,service=EJB3" is in error due to the following reason(s):
javax.naming.NameNotFoundException: queA not bound