4

使用 JBOSS 4.3 和 Java 1.5.0_15 连接到 IBM WebSphere MQ 6.0.2.3

当 JBOSS 启动时,会出现这些错误。

堆栈跟踪

Caused by: javax.resource.spi.ResourceAdapterInternalException: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'uatmq1sun:UATMQ1SUN'
        at com.ibm.mq.connector.ResourceAdapterConnectionPool.allocateConnection(ResourceAdapterConnectionPool.java:297)
        at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:333)
        at org.jboss.resource.deployment.RARDeployment.endpointActivation(RARDeployment.java:271)
        at org.jboss.resource.deployment.RARDeployment.internalInvoke(RARDeployment.java:226)
        at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:46)
        at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.activate(JBossMessageEndpointFactory.java:343)
        ... 147 more


Caused by: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'uatmq1sun:UATMQ1SUN'
        at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:614)
        at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2549)
        at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1899)
        at com.ibm.mq.jms.MQConnection.<init>(MQConnection.java:862)
        at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:4821)
        at com.ibm.mq.connector.ResourceAdapterConnectionPool.initializeJMSConnection(ResourceAdapterConnectionPool.java:445)
        at com.ibm.mq.connector.ResourceAdapterConnectionPool.createNewConnection(ResourceAdapterConnectionPool.java:359)
        at com.ibm.mq.connector.ResourceAdapterConnectionPool.allocateConnection(ResourceAdapterConnectionPool.java:284)
        ... 155 more

在 JBOSS server.log 文件的末尾。

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:ear=AmxBol.ear,jar=AmxBol.jar,name=BOLCFulfillmentMDB,service=EJB3
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' activationSpec=javax.jms.Queue:bolcustomizable@UATMQ1SUN@uatmq1sun; - nested throwable: (javax.resource.spi.ResourceAdapterInternalException: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'uatmq1sun:UATMQ1SUN')

ObjectName: jboss.j2ee:ear=AmxBol.ear,jar=AmxBol.jar,name=BOLPaymentMDB,service=EJB3
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' activationSpec=javax.jms.Queue:bolpayment@UATMQ1SUN@uatmq1sun; - nested throwable: (javax.resource.spi.ResourceAdapterInternalException: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'uatmq1sun:UATMQ1SUN')

ObjectName: jboss.j2ee:ear=AmxBol.ear,jar=AmxBol.jar,name=BOLPFulfillmentMDB,service=EJB3
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' activationSpec=javax.jms.Queue:bolpersonalized@UATMQ1SUN@uatmq1sun; - nested throwable: (javax.resource.spi.ResourceAdapterInternalException: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'uatmq1sun:UATMQ1SUN')

我不确定它是否相关,但最近对 JBOSS 应用了一个补丁。队列管理器 (UATMQ1SUN) 已启动并正在运行,但它似乎不想连接。关于什么可能是错的任何想法?MQ 和 JBOSS 生活在同一个盒子上。

hostname = uatmq1sun
QManagerName = UATMQ1SUN

[mqm@uatmq1sun ~]$ strmqm UATMQ1SUN
WebSphere MQ queue manager running.

[mqm@uatmq1sun ~]$ netstat -an | grep 1416
tcp        0      0 :::1416                     :::*                        LISTEN
4

1 回答 1

0

JMS 抛出嵌套异常,其中高级异常包含通用 JMS 失败代码,链接异常包含提供程序特定的异常。因此,例如,在创建 QMgr 对象失败的所有可能原因中,有些是本地的,包括配置错误等内容,有些仅在尝试连接时发生。换句话说,您报告的错误的某些情况是代码,有些是 MQ。如果没有链接异常,则问题不在于 MQ。

在仅在尝试连接时发生的那些(那些是 MQ 问题)中,链接异常会明确告诉您它是否已连接但发现错误的 QMgr 名称,或者没有侦听器,或者通道协商失败等. 但是这些非常具体的解释只有在代码费心打印链接的异常时才可用。

在我工作或咨询过的许多商店中,如果发现 JMS 代码不打印链接异常,则将其视为 Sev-1 缺陷,并对此进行了测试。此类代码被阻止升级到生产环境,如果在生产环境中发现,它会被拉出并作为紧急更改进行修复。预期的是代码要么打印链接的异常,要么打印它检查但不存在链接的异常。没有这些,我们在这里能做的最好的事情(或者你的运营团队在实际中断时能做的)只是猜测。

从关于JMS 异常的 WebSphere MQ 信息中心页面:

catch (JMSException je) {
    System.err.println("Caught JMSException");

    // Check for linked exceptions in JMSException
    Throwable t = je;
    while (t != null) {
        // Write out the message that is applicable to all exceptions
        System.err.println("Exception Msg: " + t.getMessage());
        // Write out the exception stack trace
        t.printStackTrace(System.err);

        // Add on specific information depending on the type of exception
        if (t instanceof JMSException) {
            JMSException je1 = (JMSException) t;
            System.err.println("JMS Error code: " + je1.getErrorCode());

            if (t instanceof JmsExceptionDetail){
                JmsExceptionDetail jed = (JmsExceptionDetail)je1;
                System.err.println("JMS Explanation: " + jed.getExplanation());
                System.err.println("JMS Explanation: " + jed.getUserAction());
            }
        } else if (t instanceof MQException) {
            MQException mqe = (MQException) t;
            System.err.println("WMQ Completion code: " + mqe.getCompCode());
            System.err.println("WMQ Reason code: " + mqe.getReason());
        } else if (t instanceof JmqiException){
            JmqiException jmqie = (JmqiException)t;
            System.err.println("WMQ Log Message: " + jmqie.getWmqLogMessage());
            System.err.println("WMQ Explanation: " + jmqie.getWmqMsgExplanation());
            System.err.println("WMQ Msg Summary: " + jmqie.getWmqMsgSummary());
            System.err.println("WMQ Msg User Response: "
                               + jmqie.getWmqMsgUserResponse());
            System.err.println("WMQ Msg Severity: " + jmqie.getWmqMsgSeverity());
        }

        // Get the next cause
        t = t.getCause();
    }
}

尝试使用任何传输提供程序调试任何JMS 异常时,请打印链接的异常。该规范定义了一个嵌套数据结构来传达异常诊断条件,并且没有理由不打印该信息。

于 2014-04-06T13:46:19.750 回答