IBM MQ 问题:JMSMQ1113 目标没有设置名称
IBM MQ Issue: JMSMQ1113 The destination does not have a name set
在 spring JMS 项目中,我尝试连接到位于远程服务器中的 IBM MQ QUEUE。该代码可以到达 IBM MQ 服务器并识别 MQ 管理器,但是当它尝试与 .bindings 文件中提到其名称的 QUEUE 通信时(此文件在 IBM MQ 服务器中生成,我将其复制到本地文件夹中,并且我提到了这个文件夹的名称作为 JNDI 资源),我收到以下错误:
INFO - Setup of JMS message listener invoker failed for destination 'TI.UNIT1.ENQ.IN' - trying to recover. Cause: JMSMQ1113: Aucun nom n'est défini pour la destination.
com.ibm.msg.client.jms.DetailedJMSException: JMSMQ1113: Aucun nom n'est défini pour la destination. Tentative d'utilisation d'une file d'attente ou d'une rubrique MQ créée à l'aide du constructeur par défaut. Un nom doit avoir été défini pour que la file d'attente puisse être utilisée. Après la création, définissez un nom dans la file d'attente ou la rubrique MQ.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:411)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:390)
at com.ibm.mq.jms.MQDestination.validateDestination(MQDestination.java:1455)
at com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:118)
at org.springframework.jms.listener.DefaultMessageListenerContainer102.createConsumer(DefaultMessageListenerContainer102.java:102)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:221)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1005)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:981)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
at java.lang.Thread.run(Thread.java:744)
我已经进行了深入的 google 搜索,但没有有效的解决方案。
@JoshMc 再次感谢您:)
这是我输入 "type .bindings | findstr TI.UNIT1.ENQ.IN" 时得到的结果:
TI.UNIT1.ENQ.IN/RefAddr/7/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/17/Content=0
TI.UNIT1.ENQ.IN/RefAddr/13/Content=2`enter code here`
TI.UNIT1.ENQ.IN/RefAddr/3/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/11/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/8/Content=0
TI.UNIT1.ENQ.IN/RefAddr/6/Type=ENC
TI.UNIT1.ENQ.IN/RefAddr/11/Type=MDW
TI.UNIT1.ENQ.IN/RefAddr/18/Type=RCCS
TI.UNIT1.ENQ.IN/RefAddr/9/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/11/Content=false
TI.UNIT1.ENQ.IN/RefAddr/13/Encoding=String
TI.UNIT1.ENQ.IN/FactoryName=com.ibm.mq.jms.MQQueueFactory
TI.UNIT1.ENQ.IN/RefAddr/5/Type=TC
TI.UNIT1.ENQ.IN/RefAddr/6/Content=273
TI.UNIT1.ENQ.IN/RefAddr/10/Type=MDR
TI.UNIT1.ENQ.IN/RefAddr/2/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/17/Type=RTOST
TI.UNIT1.ENQ.IN/RefAddr/19/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/15/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/0/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/4/Type=CCS
TI.UNIT1.ENQ.IN/RefAddr/16/Type=QMGR
TI.UNIT1.ENQ.IN/RefAddr/4/Content=1208
TI.UNIT1.ENQ.IN/RefAddr/0/Content=7
TI.UNIT1.ENQ.IN/RefAddr/18/Content=1208
TI.UNIT1.ENQ.IN/RefAddr/6/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/14/Content=-1
TI.UNIT1.ENQ.IN/RefAddr/17/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/2/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/10/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/9/Content=2
TI.UNIT1.ENQ.IN/RefAddr/3/Type=PER
TI.UNIT1.ENQ.IN/RefAddr/15/Type=PAALD
TI.UNIT1.ENQ.IN/RefAddr/8/Encoding=String
TI.UNIT1.ENQ.IN/ClassName=com.ibm.mq.jms.MQQueue
TI.UNIT1.ENQ.IN/RefAddr/16/Content=
TI.UNIT1.ENQ.IN/RefAddr/12/Content=0
TI.UNIT1.ENQ.IN/RefAddr/4/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/2/Type=PRI
TI.UNIT1.ENQ.IN/RefAddr/7/Content=1
TI.UNIT1.ENQ.IN/RefAddr/9/Type=MBODY
TI.UNIT1.ENQ.IN/RefAddr/3/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/14/Type=RAALD
TI.UNIT1.ENQ.IN/RefAddr/18/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/14/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/10/Content=false
TI.UNIT1.ENQ.IN/RefAddr/1/Type=EXP
TI.UNIT1.ENQ.IN/RefAddr/8/Type=WCFMT
TI.UNIT1.ENQ.IN/RefAddr/5/Content=0
TI.UNIT1.ENQ.IN/RefAddr/13/Type=RACP
TI.UNIT1.ENQ.IN/RefAddr/1/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/19/Content=1
TI.UNIT1.ENQ.IN/RefAddr/15/Content=-1
TI.UNIT1.ENQ.IN/RefAddr/5/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/16/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/1/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/0/Type=VER
TI.UNIT1.ENQ.IN/RefAddr/7/Type=FIQ
TI.UNIT1.ENQ.IN/RefAddr/12/Type=MDCTX
TI.UNIT1.ENQ.IN/RefAddr/19/Type=RCNV
你是对的,它错过了TI。UNIT1.ENQ.IN在TI。UNIT1.ENQ。IN/RefAddr/16/Content=
我像这样添加了缺少的队列名称 TI.UNIT1.ENQ.IN/RefAddr/16/Content=TI.UNIT1.ENQ.IN
但我仍然遇到与之前相同的错误。
英文描述错误为:
MSMQ1113: The destination does not have a name set. An attempt was made to use a MQQueue or MQTopic that was created with the default constructor. A name should have then been set before the queue was used. After creation set a name on the MQQueue or MQTopic.
您是否已验证名称为 TI.UNIT1.ENQ.IN
的 JNDI 资源包含在 .binding 文件中并且它引用了有效的 IBM MQ 队列名称?
.binding 文件是一个文本文件,查看它的一种方法是对其进行排序,每个 JNDI 条目将由多行组成。
您的文件中可能包含类似于以下内容的内容:
TI.UNIT1.ENQ.IN/RefAddr/12/Content=TI.UNIT1.ENQ.IN
TI.UNIT1.ENQ.IN/RefAddr/12/Content/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Type=QU
如果这样的条目缺失或 Content=
的右侧缺失,可能会导致您描述的问题。
我在 IBM 的 developerWorks 论坛“More information on JMSMQ1113 please”上找到了这个 post,IBM 的 Matthew B White 的回答提供了有用的信息。
更新 1
您提到将以下条目的 Content= 更改为队列名称,这是不正确的,因为此条目是 Type=QMGR
,这将是基本队列管理器名称,您可以而且应该在大多数情况下将此留空在实例中,MQ 将始终首先尝试在您连接的队列管理器上查找队列。
TI.UNIT1.ENQ.IN/RefAddr/16/Content=
TI.UNIT1.ENQ.IN/RefAddr/16/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/16/Type=QMGR
您缺少一个类似于以下 Type=QU
的条目,它将引用 IBM MQ 队列名称。
TI.UNIT1.ENQ.IN/RefAddr/12/Content=TI.UNIT1.ENQ.IN
TI.UNIT1.ENQ.IN/RefAddr/12/Content/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Type=QU
您应该回头看看您是如何生成 .binding 文件的,看看是否遗漏了什么。
如果您使用 JMSAdmin 生成 .binding 文件,该命令至少看起来像这样:
DEF Q(TI.UNIT1.ENQ.IN) QUEUE(TI.UNIT1.ENQ.IN)
Q
是 JNDI 资源名称(它不必与队列名称匹配)。 QUEUE
是与 JNDI 资源名称关联的 IBM MQ 队列的名称。
在 spring JMS 项目中,我尝试连接到位于远程服务器中的 IBM MQ QUEUE。该代码可以到达 IBM MQ 服务器并识别 MQ 管理器,但是当它尝试与 .bindings 文件中提到其名称的 QUEUE 通信时(此文件在 IBM MQ 服务器中生成,我将其复制到本地文件夹中,并且我提到了这个文件夹的名称作为 JNDI 资源),我收到以下错误:
INFO - Setup of JMS message listener invoker failed for destination 'TI.UNIT1.ENQ.IN' - trying to recover. Cause: JMSMQ1113: Aucun nom n'est défini pour la destination.
com.ibm.msg.client.jms.DetailedJMSException: JMSMQ1113: Aucun nom n'est défini pour la destination. Tentative d'utilisation d'une file d'attente ou d'une rubrique MQ créée à l'aide du constructeur par défaut. Un nom doit avoir été défini pour que la file d'attente puisse être utilisée. Après la création, définissez un nom dans la file d'attente ou la rubrique MQ.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:411)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:390)
at com.ibm.mq.jms.MQDestination.validateDestination(MQDestination.java:1455)
at com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:118)
at org.springframework.jms.listener.DefaultMessageListenerContainer102.createConsumer(DefaultMessageListenerContainer102.java:102)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:221)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1005)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:981)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
at java.lang.Thread.run(Thread.java:744)
我已经进行了深入的 google 搜索,但没有有效的解决方案。
@JoshMc 再次感谢您:) 这是我输入 "type .bindings | findstr TI.UNIT1.ENQ.IN" 时得到的结果:
TI.UNIT1.ENQ.IN/RefAddr/7/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/17/Content=0
TI.UNIT1.ENQ.IN/RefAddr/13/Content=2`enter code here`
TI.UNIT1.ENQ.IN/RefAddr/3/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/11/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/8/Content=0
TI.UNIT1.ENQ.IN/RefAddr/6/Type=ENC
TI.UNIT1.ENQ.IN/RefAddr/11/Type=MDW
TI.UNIT1.ENQ.IN/RefAddr/18/Type=RCCS
TI.UNIT1.ENQ.IN/RefAddr/9/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/11/Content=false
TI.UNIT1.ENQ.IN/RefAddr/13/Encoding=String
TI.UNIT1.ENQ.IN/FactoryName=com.ibm.mq.jms.MQQueueFactory
TI.UNIT1.ENQ.IN/RefAddr/5/Type=TC
TI.UNIT1.ENQ.IN/RefAddr/6/Content=273
TI.UNIT1.ENQ.IN/RefAddr/10/Type=MDR
TI.UNIT1.ENQ.IN/RefAddr/2/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/17/Type=RTOST
TI.UNIT1.ENQ.IN/RefAddr/19/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/15/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/0/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/4/Type=CCS
TI.UNIT1.ENQ.IN/RefAddr/16/Type=QMGR
TI.UNIT1.ENQ.IN/RefAddr/4/Content=1208
TI.UNIT1.ENQ.IN/RefAddr/0/Content=7
TI.UNIT1.ENQ.IN/RefAddr/18/Content=1208
TI.UNIT1.ENQ.IN/RefAddr/6/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/14/Content=-1
TI.UNIT1.ENQ.IN/RefAddr/17/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/2/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/10/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/9/Content=2
TI.UNIT1.ENQ.IN/RefAddr/3/Type=PER
TI.UNIT1.ENQ.IN/RefAddr/15/Type=PAALD
TI.UNIT1.ENQ.IN/RefAddr/8/Encoding=String
TI.UNIT1.ENQ.IN/ClassName=com.ibm.mq.jms.MQQueue
TI.UNIT1.ENQ.IN/RefAddr/16/Content=
TI.UNIT1.ENQ.IN/RefAddr/12/Content=0
TI.UNIT1.ENQ.IN/RefAddr/4/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/2/Type=PRI
TI.UNIT1.ENQ.IN/RefAddr/7/Content=1
TI.UNIT1.ENQ.IN/RefAddr/9/Type=MBODY
TI.UNIT1.ENQ.IN/RefAddr/3/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/14/Type=RAALD
TI.UNIT1.ENQ.IN/RefAddr/18/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/14/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/10/Content=false
TI.UNIT1.ENQ.IN/RefAddr/1/Type=EXP
TI.UNIT1.ENQ.IN/RefAddr/8/Type=WCFMT
TI.UNIT1.ENQ.IN/RefAddr/5/Content=0
TI.UNIT1.ENQ.IN/RefAddr/13/Type=RACP
TI.UNIT1.ENQ.IN/RefAddr/1/Content=-2
TI.UNIT1.ENQ.IN/RefAddr/19/Content=1
TI.UNIT1.ENQ.IN/RefAddr/15/Content=-1
TI.UNIT1.ENQ.IN/RefAddr/5/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/16/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/1/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/0/Type=VER
TI.UNIT1.ENQ.IN/RefAddr/7/Type=FIQ
TI.UNIT1.ENQ.IN/RefAddr/12/Type=MDCTX
TI.UNIT1.ENQ.IN/RefAddr/19/Type=RCNV
你是对的,它错过了TI。UNIT1.ENQ.IN在TI。UNIT1.ENQ。IN/RefAddr/16/Content= 我像这样添加了缺少的队列名称 TI.UNIT1.ENQ.IN/RefAddr/16/Content=TI.UNIT1.ENQ.IN 但我仍然遇到与之前相同的错误。
英文描述错误为:
MSMQ1113: The destination does not have a name set. An attempt was made to use a MQQueue or MQTopic that was created with the default constructor. A name should have then been set before the queue was used. After creation set a name on the MQQueue or MQTopic.
您是否已验证名称为 TI.UNIT1.ENQ.IN
的 JNDI 资源包含在 .binding 文件中并且它引用了有效的 IBM MQ 队列名称?
.binding 文件是一个文本文件,查看它的一种方法是对其进行排序,每个 JNDI 条目将由多行组成。
您的文件中可能包含类似于以下内容的内容:
TI.UNIT1.ENQ.IN/RefAddr/12/Content=TI.UNIT1.ENQ.IN
TI.UNIT1.ENQ.IN/RefAddr/12/Content/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Type=QU
如果这样的条目缺失或 Content=
的右侧缺失,可能会导致您描述的问题。
我在 IBM 的 developerWorks 论坛“More information on JMSMQ1113 please”上找到了这个 post,IBM 的 Matthew B White 的回答提供了有用的信息。
更新 1
您提到将以下条目的 Content= 更改为队列名称,这是不正确的,因为此条目是 Type=QMGR
,这将是基本队列管理器名称,您可以而且应该在大多数情况下将此留空在实例中,MQ 将始终首先尝试在您连接的队列管理器上查找队列。
TI.UNIT1.ENQ.IN/RefAddr/16/Content=
TI.UNIT1.ENQ.IN/RefAddr/16/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/16/Type=QMGR
您缺少一个类似于以下 Type=QU
的条目,它将引用 IBM MQ 队列名称。
TI.UNIT1.ENQ.IN/RefAddr/12/Content=TI.UNIT1.ENQ.IN
TI.UNIT1.ENQ.IN/RefAddr/12/Content/Encoding=String
TI.UNIT1.ENQ.IN/RefAddr/12/Type=QU
您应该回头看看您是如何生成 .binding 文件的,看看是否遗漏了什么。
如果您使用 JMSAdmin 生成 .binding 文件,该命令至少看起来像这样:
DEF Q(TI.UNIT1.ENQ.IN) QUEUE(TI.UNIT1.ENQ.IN)
Q
是 JNDI 资源名称(它不必与队列名称匹配)。 QUEUE
是与 JNDI 资源名称关联的 IBM MQ 队列的名称。