I need some help having my Tomcat Installation (built on 64 bit Java) connect to an MQ Server using a CCDT file. The MQ Server is a 64 installation with 7.0.0.9 version. As of now, I get the following error message in the application logs-

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"
| ********************************************************************'

The steps I tried are as follows –

Downloaded and installed the 64bit MQ Client

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.

As part of the setenv.sh file of my Tomcat Installation, I configured the following. The MQ related sections are highlighted in 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

Thoughts on how to resolve this?

有帮助吗?

解决方案 2

Thanks Roger!

Added this to the context.xml of the tomcat application

<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 />

Also, commented out the following two lines from setenv.sh

#export MQCHLLIB=/apps/install/tomcat7/shared
#export MQCHLTAB=AMQCLCHL.TAB

..and everything works perfectly. Thanks a lot for helping with this!

其他提示

Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.

This error message is telling you that the MQ client library is trying to connect in 'bindings' (not client) mode to a local (not remote) queue manager and it cannot find the required shared library.

You set MQCHLLIB and MQCHLTAB but Java/JMS MQ layer does not care. You need to use a MQ JNDI and either specify all of your connection information in it or add an entry to point to your CCDT.

create CF(CF_TEST)
alter CF(CF_TEST) TRANSPORT(CLIENT)
alter CF(CF_TEST) CCDT(file:///apps/install/tomcat7/shared AMQCLCHL.TAB)

For more information about MQ/JMS using CCDT file see:

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

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top