我需要一些帮助,让我的Tomcat安装(基于64位Java构建)使用CCDT文件连接到MQ服务器。 MQ Server是64安装,版本为7.0.0.9。截至目前,我在应用程序日志中收到以下错误消息 -
Caused by: com.ibm.mq.jmqi.local.LocalMQ$3: CC=2;RC=2495;AMQ8598:
-----------------------------------------------------------------------
| Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.
|
| The JVM attempted to load the platform native library 'mqjbnd',
| which was mapped to the filename: 'libmqjbnd.so'.
|
| When attempting to load the library, the JVM reported the error
| message:
| 'no mqjbnd in java.library.path'
|
| The JVM's bit-size is: '64'
|
| The library path which was used to locate this library was:
| '*** Configured java.library.path **********************************
| "/opt/mqm/java/lib64"
| ********************************************************************'
我尝试的步骤如下 -
下载并安装64位MQ客户端
dspmqver -a
Name: WebSphere MQ
Version: 7.0.1.11
CMVC level: p701-111-130925
BuildType: IKAP - (Production)
Platform: WebSphere MQ for Linux (x86-64 platform)
Mode: 64-bit
O/S: Linux 2.6.32-358.2.1.el6.x86_64
AMQ8351: WebSphere MQ Java environment has not been configured correctly.
作为我的Tomcat安装的setenv.sh文件的一部分,我配置了以下内容。 MQ相关部分在RED
中突出显示export JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/opt/mqm/java/lib64"
CLASSPATH=$CLASSPATH:/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar
export ORACLE_HOME=/apps/oracle/product/11.1.0.7.CL
export LD_LIBRARY_PATH=/apps/oracle/product/11.1.0.7.CL/jdbc/lib/:/apps/install/tomcat-native/lib/
export MQCHLLIB=/apps/install/tomcat7/shared
export MQCHLTAB=AMQCLCHL.TAB
export MQ_JAVA_INSTALL_PATH=/opt/mqm/java
export MQ_JAVA_DATA_PATH=/var/mqm
export MQ_JAVA_LIB_PATH=/opt/mqm/java/lib64
export JAVA_HOME=/apps/install/java/jre1.7.0_45
export JAVA_BINDIR=$JAVA_HOME/bin
export PATH=$JAVA_BINDIR:$PATH
关于如何解决这个问题的想法?
答案 0 :(得分:0)
无法加载WebSphere MQ本机JNI库:' mqjbnd'。
此错误消息告诉您MQ客户端库正在尝试连接'绑定' (非客户端)模式到本地(非远程)队列管理器,它找不到所需的共享库。
您设置了MQCHLLIB和MQCHLTAB,但Java / JMS MQ层并不关心。您需要使用MQ JNDI并在其中指定所有连接信息或添加一个条目以指向您的CCDT。
create CF(CF_TEST)
alter CF(CF_TEST) TRANSPORT(CLIENT)
alter CF(CF_TEST) CCDT(file:///apps/install/tomcat7/shared AMQCLCHL.TAB)
有关使用CCDT文件的MQ / JMS的更多信息,请参阅:
http://www-01.ibm.com/support/docview.wss?uid=swg27020862
http://www.ibm.com/developerworks/websphere/library/techarticles/0506_barrago/0506_barrago.html
答案 1 :(得分:0)
感谢罗杰!
将此添加到tomcat应用程序的context.xml
<Resource
name="jms/MyConnectionFactory"
auth="Container"
type="com.ibm.mq.jms.MQQueueConnectionFactory"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
description="JMS Queue Connection Factory for sending messages"
CCDTURL="file:///apps/install/tomcat7/shared/AMQCLCHL.TAB"
QMGR="MYQM />
另外,从setenv.sh
中注释掉以下两行#export MQCHLLIB=/apps/install/tomcat7/shared
#export MQCHLTAB=AMQCLCHL.TAB
..一切都很完美。非常感谢你帮忙解决这个问题!