AMQ8568 RC=2495 mqjbnd was not found, or AMQ8351 Java environment has not been configured correctly

Technote (troubleshooting)


WebSphere MQ V7 in 64-bit:
You issue "dspmqver -p 4" or "dspmqver -p 7" and you receive the following error:

Name: IBM WebSphere MQ
CMVC Level: k000-L090724 mqjbnd=CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]::/opt/mqm/java/lib/ /opt/mqm/java/lib/ cannot open shared object file: No such file or directory
Build Type: Production

You issue the "ls" command on the file that is mentioned in the error, and the file exists and has the proper ownership and permissions:

$ ls -l /opt/mqm/java/lib/
-r-xr-xr-x 1 mqm mqm 326943 2009-08-13 12:01 /opt/mqm/java/lib/

Or, you may get the following error:
AMQ8351: WebSphere MQ Java environment has not been configured correctly.


The following web page in the MQ documentation explains the environment variables needed to run programs that use MQ classes for Java™ and for JMS (such as dspmqver):
Environment variables relevant to WebSphere MQ classes for Java

In the case of the above AMQ8568 error, the problem is that the 64-bit library directory was NOT specified when dealing with 64-bit operating systems and the MQ script setjmsenv" was invoked either manually or in the login profile, with the resulting value for the following environment variable (which points to the 32-bit library files):


Resolving the problem

+++ Note if using MQ 7.1 or 7.5 or 8.0

If you are using MQ 7.1 or later, then you need to run the command ". setmqenv" instead of ". setjmsenv" or ". setjmsenv64", in order to setup the proper MQ environment variables, including the ones for Java or JMS.
For example, if you have installed the MQ 7.1 code in Linux and it is in Installation1, then you can issue the following (you MUST include the leading dot and space, in order to "source" the command setmqenv!!!!!)
. /opt/mqm/bin/setmqenv -n Installation1

+++ MQ 7.0: There are 4 steps you may need to do:

STEP 1: If you are using a 64-bit platform, then instead of issuing "setjmsenv" you need to issue the following command.

. setjmsenv64

NOTE: This command is needed whether you use only MQ classes for Java, or MQ classes for JMS.

The output of the above command looks like this:

$ . setjmsenv64
MQ_JAVA_INSTALL_PATH is /opt/mqm/java
MQ_JAVA_DATA_PATH is /var/mqm
MQ_JAVA_LIB_PATH is /opt/mqm/java/lib64
CLASSPATH is :/opt/mqm/java/lib/

Additional information

Notice that the 64-bit libraries are now set:

Then, running the "dspmqver -p 4" command will execute without errors:
Name: IBM WebSphere MQ
CMVC Level: k000-L090724 mqjbnd=k000-L090724
Build Type: Production

Explanation on the correct syntax to run setjmsenv or setjmsenv64:

It is important to execute "setjmsenv" or "setjmsenv64" with a dot and a space:

. setjmsenv

. setjmsenv64

The dot and space are needed to ensure that the environment variables set by the script are made available in the current process space for other applications running from the same command prompt.

The following shows an example of the errors that you will see when NOT using the dot and space:

$ setjmsenv64
MQ_JAVA_INSTALL_PATH is /opt/mqm/java
MQ_JAVA_DATA_PATH is /var/mqm
MQ_JAVA_LIB_PATH is /opt/mqm/java/lib64
CLASSPATH is :/opt/mqm/java/lib/

Notice that the environment variable will NOT be set (the echo command will display a blank)
< no value >

Notice that because none of the required environment for MQ were set by setjmsenv64 (or setjmsenv) for the current process space, then the error AMQ8351 is displayed:

$ dspmqver -p 4
AMQ8351: WebSphere MQ Java environment has not been configured correctly.

STEP 2: For AIX Only:

There should not be default symbolic links in /usr/lib to the 32-bit MQ libraries.
One possible cause for the error 2495 is that /usr/lib has symbolic links for 32-bit MQ libraries, which interferes with the proper loading of 64-bit libraries. The solution is to run the MQ script "dltmqlnk" to delete these symbolic links.

For more information on dltmqlnk see the following web page:

Implications of a 64-bit queue manager

You can do the following to check if these symbolic links exist:

% ls -l /usr/lib/*mq*
ls: 0653-341 The file /usr/lib/*mq* does not exist.

STEP 3: You need to specify Java 64-bit for runtime.
A common cause for 2495 is that the Java 32-bit code is executed at runtime on a 64-bit machine.
Thus, it is important to set the PATH to point to the 64-bit code, for example:
export JAVA_HOME=/usr/java5_64

You can use the following command to check which "java" are you executing at runtime. The following shows that it is a 64-bit version:
% which java

% java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap64dev-20070511(SR5))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64 j9vmap6423-20070426 (JIT enabled)

STEP 4: You need to specify -Djava.library.path with the proper 64-bit java libraries:
The 2495 error also occurs when using the 32-bit libraries to run MQ Java programs in 64-bit. This is incorrect:
AIX: java -Djava.library.path=/usr/mqm/java/lib applicationName
Non-AIX: java -Djava.library.path=/opt/mqm/java/lib applicationName

This is correct:
AIX: java -Djava.library.path=/usr/mqm/java/lib64 applicationName
Non-AIX: java -Djava.library.path=/opt/mqm/java/lib64 applicationName

+++ Note for z/OS

Ensure that you are not using trailing blanks.
For example, notice that there is a trailing blank in the 4th line in the following set of statements.

JVMJZBL2999T #LIBPATH="${LIBPATH}:/mqm/V7R0M1/java/lib"
JVMJZBL2999T #LIBPATH="${LIBPATH}:/usr/lpp/java/J6.0.1/lib"
JVMJZBL2999T LIBPATH="${LIBPATH}:/usr/lpp/mqm/V7R0M1/java/lib/ "

It was necessary to change the LIBPATH setting in the JCL to be:

+++ WebSphere Application Server when using MQ as the JMS provider

If you are seeing the exception "mqjbnd (Not found in java.library.path)" in WebSphere Application Server when using MQ as the JMS provider, see the following technote:

UnsatisfiedLinkError: mqjbnd (Not found in java.library.path), CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]

Related information

Displaying the WebSphere MQ version
WAS Exception: mqjbnd (Not found in java.library.path)
A Japanese translation is available

Product Alias/Synonym


Document information

More support for:

WebSphere MQ

Software version:

7.0, 7.0.1, 7.1, 7.5, 8.0

Operating system(s):

AIX, HP-UX, Linux, Solaris

Reference #:


Modified date:


Translate my page

Content navigation