有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Mq连接错误2058

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

我正在使用UserCredentialsConnectionFactoryAdapter、MQQueueConnectionFactory和jms侦听器

    <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客户端应用程序。此程序可以连接到此队列管理器并从中读取消息

还有什么不对劲


共 (1) 个答案

  1. # 1 楼答案

    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.