gpt4 book ai didi

java - MQ 连接错误 2058

转载 作者:行者123 更新时间:2023-12-01 06:10:05 31 4
gpt4 key购买 nike

我有一个 spring 核心应用程序,其配置如下。

我正在使用 UserCredentialsConnectionFactoryAdapter、MQQueueConnectionFactory 和 jms-listener。

    <jms:listener-container container-type="default"
connection-factory="userConnectionFactory" acknowledge="auto">
<jms:listener destination="${QUEUE_NAME_IN_GEN}" ref="messageListener"
method="onMessage" />
</jms:listener-container>

<bean id="userConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory">
<ref bean="mqConnectionFactory" />
</property>
<property name="username" value="${MQ_USER_ID}" />
</bean>

<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName">
<value>${MQ_HOST_NAME}</value>
</property>
<property name="port">
<value>${MQ_PORT}</value>
</property>
<property name="queueManager">
<value>${QUEUE_MANAGER}</value>
</property>
<property name="transportType">
<value>1</value>
</property>
</bean>

在应用程序启动时,监听器完美地在一台机器上启动。当我在不同的服务器上尝试使用相同的工件时,监听器无法启动并出现以下错误:

[org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] ERROR org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:909) - Could not refresh JMS Connection for destination 'R.ABCDEF' - retrying in 5000 ms. Cause: MQJMS2005: failed to create MQQueueManager for 'myhost:dev'; nested exception is com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt

为了弄清楚这是否与第二台服务器上的 Unix 帐户权限问题有关,我编写了一个简单的 MQ 客户端应用程序。该程序可以连接到该队列管理器并从中读取消息。

还有什么可能是错误的吗?

最佳答案

2058 表明队列管理器名称不正确。根据 IBM 的技术说明,这是最常见的原因,但还有其他原因。

以下摘录取自此 technote :

Ensure that the queue manager name is specified correctly on:

  • MQCONN API calls
  • QREMOTE object definitions
  • Client connection channel definitions

Debugging QCF, TCF, or Client connection problems are much more complex.

  • Ensure that the connection request is routed to the intended machine and queue manager.
  • Verify that the listener program is starting the channel on the correct queue manager.
  • Ensure that the specifications for the client environment variables are correct.
  • mqserver
  • mqchllib
  • mqchltab

If you are using a client channel table (amqclchl.tab), then verify that your client connection channel definition has the correct queue manager name (QMNAME) specified.

  • Specify the correct queue manager name.
  • Correct channel routing problems.
  • Correct inetd listener configuration problems.
  • Correct client related configuration problems.

关于java - MQ 连接错误 2058,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36398597/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com