MQJMS2005:无法从JBOSS创建MQQueueManager

时间:2013-04-04 19:02:44

标签: jboss ibm-mq

使用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

1 个答案:

答案 0 :(得分:0)

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

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

在我工作或咨询过的许多商店中,如果发现JMS代码不打印链接的异常,则会将其视为Sev-1缺陷,并对此进行测试。这样的代码被阻止被提升为生产,并且如果在生产中找到它,则作为紧急变化被拉动和修复。预期的是代码要么打印链接的异常,要么打印它检查但没有链接的异常。没有这些,我们在这里做的最好(或者你的运营团队可以在实际停电中做)只是猜测。

来自JMS exceptions上的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例外时,请打印链接的例外。规范定义了一个嵌套的数据结构来传达异常诊断条件,没有理由不打印该信息。