views:

56

answers:

3

hi guys, i am trying to access MQ queues using JMS. i am getting the below

java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path

i am passing

-Djava.library.path="C:\Program Files\IBM\WebSphere MQ\java\lib"

as the VM argument while running the program in eclipse. This issue is discussed quite a lot on the net but with out any conclusion. Has anyone resolved this? TIA.

A: 

Here is an easy recipe: Tell the Java VM to Load the DLL. Is your code similiar, e.g. do you use System.loadLibrary to load mqjbnd05.dll?

If yes - does it work outside eclipse, like starting the application from the command line? If this is the case, you could try starting the whole eclipse IDE with that library path.

And sometimes we have trouble with pathnames that contain spaces. Copy the dll to C:\, put that on the lib path and try again.


Ah, that's the problem, the specified dll is missing. This blog has a solution. Good luck!

Andreas_D
the thing is i dont find this mqjbn05.dll, all i have is mqjbnd.dll the path for which i have specified at the VM arg section
hakish
Hey thanks for your inputs though!! :)
hakish
A: 

This can happen if you actually installed MQ Client instead of MQ Server.

IBM has even written a whole help page about it:

WebSphere MQ Client installation missing mqjb*.dll files

Problem(Abstract)

You install the WebSphere MQ Client and notice three dll's are missing from the \Program Files\IBM\WebSphere MQ\Java\lib\ directory.

Symptom

The following dlls appear in the directory on a server install, but are not part of the Java™ client:

  • 03/17/2003 10:59a 19,456 mqjbdf02.dll
  • 03/17/2003 10:59a 57,856 mqjbnd05.dll
  • 03/17/2003 10:59a 36,864 MQXAi02.dll

The subdirectory \jdbc\ appears on the server, but not on the client machine.

  • 03/17/2003 10:59a 61,440 jdbcdb2.dll
  • 03/17/2003 10:59a 61,440 jdbcora.dll

Cause

The files are missing because they are not provided nor needed in a client install.

Resolving the problem

The files are only included in the WebSphere MQ Server product.

BalusC
+1  A: 

You probably have some older MQ jar files either in your CLASSPATH, in the lib or in the EAR.
Remove them and you should be fine.
You should not put MQ files in your EAR or in the WEB-INF/lib folders. They should be in the classpath of your appserver.

Romain Hippeau
yes i actually had MQ Server 7 installed and had used version 6 jars so when i reverted them to use 7 the client started working fine..but its strange that MQ products are not backward compatible
hakish
@hakish - Actually they are, you can access MQ7 with MQ6 and vice-versa, you just cannot use version 7 .dll files with v6 jars.
Romain Hippeau