简体   繁体   English

连接到MQ管理器会收到MQ错误2495

[英]Connecting to MQ manager get MQ error 2495

We have an application that was fully working in staging but when we deploy it on production we are getting MQ error 2495. We are running the application in a Tomcat 8.5 and we are using the same MQ libraries (8.0.0.6). 我们有一个可以在登台阶段完全正常工作的应用程序,但是当将其部署到生产环境中时,会出现MQ错误2495。我们在Tomcat 8.5中运行该应用程序,并且使用的是相同的MQ库(8.0.0.6)。 The server OS is Windows. 服务器操作系统是Windows。

The code for reading the message from the MQ looks like: 从MQ读取消息的代码如下:

MQEnvironment.hostname = queueSettings.getServer();
        MQEnvironment.channel = queueSettings.getChannel();
        MQEnvironment.port = queueSettings.getPort();

        MQQueueManager queueManager = new MQQueueManager(queueSettings.getQueueManager());

        int openOptions = CMQC.MQCBDO_FAIL_IF_QUIESCING | CMQC.MQOO_INPUT_SHARED | CMQC.MQOO_BROWSE;

        MQQueue queue = queueManager.accessQueue(queueSettings.getQueue(), openOptions);

De full stacktrace of the error looks like: 错误的完整堆栈跟踪看起来像:

com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2495'.
at com.ibm.mq.MQSESSION.(MQSESSION.java:2063)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:2103)
at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:207)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:185)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:230)
at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:96)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:758)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:706)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:670)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:145)
at com.ibm.mq.MQQueueManager.(MQQueueManager.java:675)
at com.atlascopco.cpq.connections.MQConnection.readMessagesFromQueue(MQConnection.java:92)
at com.atlascopco.cpq.tasks.ResponseHandlerTask.run(ResponseHandlerTask.java:43)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd64' was not found. For a client installation this is expected. [3=mqjbnd64]
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1202)
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:272)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:260)
at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:223)
at com.ibm.mq.jmqi.local.LocalMQ.(LocalMQ.java:1255)
at com.ibm.mq.jmqi.local.LocalServer.(LocalServer.java:219)
at sun.reflect.GeneratedConstructorAccessor10933.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:656)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:590)
at com.ibm.mq.MQSESSION.(MQSESSION.java:2056)
... 15 common frames omitted
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd64 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1146)
... 27 common frames omitted

How can I find the issue? 我如何找到问题?

The issue is in your stack trace: 问题出在您的堆栈跟踪中:

Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd64' was not found. For a client installation this is expected. [3=mqjbnd64]
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd64 in java.library.path

This is documented on the IBM MQ Knowledge center page " Configuring the Java Native Interface (JNI) libraries " 在IBM MQ知识中心页面“ 配置Java本机接口(JNI)库 ”中对此进行了记录。

On windows the default location for the libraries are below: 在Windows上,库的默认位置如下:

MQ_INSTALLATION_PATH\java\lib (32-bit libraries)
MQ_INSTALLATION_PATH\java\lib64 (64-bit libraries)

You can specify the location of this library one of two ways (both examples below would be for a 64bit JRE if MQ is installed in the default location, if you are running a 32bit JRE use the lib directory instead of the lib64 directory): 您可以使用以下两种方法之一来指定该库的位置(如果在默认位置安装了MQ,则下面的两个示例都是针对64位JRE的;如果运行的是32位JRE,请使用lib目录而不是lib64目录):

  1. With a JVM argument, for example: 使用JVM参数,例如:
    -Djava.library.path=C:\\Program Files\\IBM\\MQ\\java\\lib64
  2. Via an OS environment variable. 通过OS环境变量。 In your case on Windows use: 在Windows上,请使用:
    set PATH=C:\\Program Files\\IBM\\MQ\\java\\lib64;%PATH%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有JDk8的TLSv2带有MQ8的密码套件? - TLSv2 with JDk8 Ciphersuites with MQ8? 如何验证池的IBM MQ连接 - How to validate IBM MQ connection for Pool 两个简单的 IBM MQ 客户端测试写入 MQ 队列 - 为什么一个有效,而另一个无效? - Two simple IBM MQ client tests write to MQ queue - why does one work, but, NOT the other? NoClassDefFoundError 无法初始化类 com.ibm.mq.headers.internal.HeaderType - NoClassDefFoundError Could not initialize class com.ibm.mq.headers.internal.HeaderType JBoss Fuse/REST DSL - 为什么我的修改(使用 IBM MQ)不起作用? - JBoss Fuse/REST DSL - Why do my modifications (to use IBM MQ) not work? 我们可以将我的Java-Spring-mvc服务连接到IBM MQ而不用从队列中生成或使用绑定文件吗? - can we connect my Java-Spring-mvc service to IBM MQ without generating or using binding files from the queues 使用本机查询实体管理器获取 jsonArray - Get jsonArray Using Native query entity manager react-native-incall-manager 4.0.0 Android错误JDK - react-native-incall-manager 4.0.0 Android error JDK NoSuchAlgorithmException:通过 JAVA 8 连接到 SSL 网站时构建实现时出错 - NoSuchAlgorithmException: Error constructing implementation while connecting to SSL website through JAVA 8 为什么在进行flatmap()调用时出现编译错误? - Why do I get compilation error when doing flatmap() call?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM