如何将 websphere mq 7 队列映射到 EJB 3 目的地名称
我需要将 WebSphere MQ7 队列(例如队列管理器 QMA 中的 queA)映射到 EJB3 MDB。
我使用
创建了 MQ 队列管理器和队列 crtmqm QMA
并使用 strmqm MQA
启动它
然后我写了一个文件文件名 QMA.conf
并包含定义 QLOCAL ('queA')
将其排列并运行命令runmqsc QMA
runmqsc QMA
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
I need to map WebSphere MQ7 queue (Say queA in Queue Manager QMA) to a EJB3 MDB.
I created the MQ Queue Manager and Queue usingcrtmqm QMA
and start it using strmqm MQA
Then i wrote a file file name QMA.conf
and includedDEFINE QLOCAL ('queA')
line it and run the commandrunmqsc QMA < QMA.conf
then I runstrmqcsv MQA &
runmqlsr -m QMA -t TCP &
All these steps done as mqm logged user.
Then I follow
http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ
link and configure RAR to the jboss 5.1. When I run the test connection that also succeeded.
There I include
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
and In my MDB I include
@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")
When I try to deploy the bean it says
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你写过
useJNDI 属性暗示“queA”是将 JMS 队列绑定到 JNDI 命名空间的名称 - 这并不直接对应于您在此处定义的队列
如果您希望它引用队列管理器上的物理 WMQ 队列,那么您需要将 useJNDI 属性设置为 false,在这种情况下,目标指定队列管理器上的队列名称,而不是 JNDI姓名。另一方面,如果您确实想使用目的地的 JNDI 查找,那么您需要确保指定的目的地名称与 -ds.xml 文件中的队列定义匹配,例如
将对应于
注释 mbean 的 JNDIName 属性对应于目标名称
You've written
with the useJNDI property implying that 'queA' is the name under which the JMS Queue is bound into the JNDI namespace - this does not directly correspond to the queue you have defined here
If you want it to refer to a physical WMQ queue on your queue manager then you need the useJNDI property set to false, in which case destination specifies the name of a queue on the queue manager, not a JNDI name. On the other hand, if you do want to use JNDI lookup of Destinations then you need to ensure that the destination name specified matches the Queue definition in the -ds.xml file, e.g.
would correspond to
note the JNDIName attribute of the mbean corresponds to the destination name