2014-03-27 97 views
0

我需要一些幫助,使我的Tomcat安裝(建立在64位Java上)使用CCDT文件連接到MQ服務器。 MQ Server是具有7.0.0.9版本的64位安裝。截至目前,我得到了應用程序的以下錯誤消息日誌 -使用CCDT |的Tomcat與MQ服務器的連接64位

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中的相關部分以紅色突出顯示

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

感謝羅傑!

將此添加到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 

..和一切完美。非常感謝您的幫助!

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) 

有關使用MQ/JMS CCDT文件的詳細信息請參閱:

http://www-01.ibm.com/support/docview.wss?uid=swg27020862

http://www.ibm.com/developerworks/websphere/library/techarticles/0506_barrago/0506_barrago.html