Jboss 如何将websphere mq 7队列映射到EJB 3 destinationName
我需要将WebSphereMQ7队列(比如队列管理器QMA中的queA)映射到EJB3 MDB 我使用Jboss 如何将websphere mq 7队列映射到EJB 3 destinationName,jboss,ejb-3.0,jboss5.x,ibm-mq,message-driven-bean,Jboss,Ejb 3.0,Jboss5.x,Ibm Mq,Message Driven Bean,我需要将WebSphereMQ7队列(比如队列管理器QMA中的queA)映射到EJB3 MDB 我使用 crtmqm-QMA并使用strmqm-MQA 然后我写了一个文件名QMA.conf并包含 定义QLOCAL('queA') 将其对齐并运行命令 runmqsc-QMA
crtmqm-QMA
并使用strmqm-MQA
然后我写了一个文件名
QMA.conf
并包含定义QLOCAL('queA')
将其对齐并运行命令
runmqsc-QMA
然后我跑
strmqcsv MQA&
runmqlsr-mqma-ttcp&
所有这些步骤都是作为mqm日志用户完成的 然后我跟着 将RAR链接并配置到JBoss5.1。当我运行同样成功的测试连接时 我包括在内
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
@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")
在我的MDB中,我包括
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
@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
你已经写信了
useJNDI属性意味着'queA'是JMS队列绑定到JNDI命名空间的名称,这与您在此处定义的队列不直接对应
定义QLOCAL('queA')
如果希望它引用队列管理器上的物理WMQ队列,则需要将useJNDI属性设置为false,在这种情况下,destination指定队列管理器上的队列名称,而不是JNDI名称。另一方面,如果确实希望使用JNDI查找目标,则需要确保指定的目标名称与-ds.xml文件中的队列定义匹配,例如
相当于
<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=request_queue">
<attribute name="JNDIName">jms/request</attribute>
<depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=QMA
baseQueueName=queA
</attribute>
</mbean>
jms/请求
jca:service=RARDeployment,name='wmq.jmsra.rar'
javax.jms.Queue
baseQueueManagerName=QMA
baseQueueName=queA
注意mbean的JNDIName属性对应于目标名称您是否验证了QMA中确实存在queA?我读到您创建了一个脚本来定义它,但并没有通过在runmqsc中显示它或在WMQ资源管理器中查看它来验证它的存在。是的队列在WQM中可用。好吧,这是一个开始。不幸的是,我只能做到这一点。我在WMQ部分没有看到任何会阻止您连接的内容,我也不知道JBoss配置。我将提供的一件事是,如果您已经安装了完整的WMQ客户端(而不仅仅是获取jar文件),那么您可以使用示例程序来验证您的连接。如果您可以使用现有的WMQ配置来使用amqsputc进行连接,那么您已经将问题缩小到JBoss配置。当然,如果你所做的只是抓取罐子,那么你所能执行的诊断就非常有限。我已经更新了标签,使其包括在内,这样这个问题将从这群人那里得到更多的关注。希望这将产生一个实际的答案。:-)