Author |
Message
|
Sarah Lee |
Posted: Tue Jun 12, 2007 6:01 am Post subject: Exception in thread "main" java.lang.UnsatisfiedLi |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
I'm trying to connect to MQ using my Java code. I am using Eclipse IDE. . I have tried all adding everything possible to my classpath, but nothing works. Can someone help?
I am getting the following error -
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\IBM\WebSphere MQ\Java\lib\mqjbnd05.dll: The specified procedure could not be found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:873)
at com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.server.MQSESSION.<clinit>(MQSESSION.java:221)
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:6
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:498)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:163)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:153)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:189)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:171)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:754)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:688)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:469)
at com.ibm.stubframe.mq.MQListener.<init>(MQListener.java:3 |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 6:07 am Post subject: Re: Exception in thread "main" java.lang.Unsatisfi |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sarah Lee wrote: |
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\IBM\WebSphere MQ\Java\lib\mqjbnd05.dll: The specified procedure could not be found |
While adding everything possible to the classpath, have you determined that this dll is in the location specified? And is accessable in terms of security?
Also what kind of connection are you trying to establish? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue Jun 12, 2007 6:08 am Post subject: Re: Exception in thread "main" java.lang.Unsatisfi |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
|
Back to top |
|
 |
Sarah Lee |
Posted: Tue Jun 12, 2007 6:24 am Post subject: |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
Thanks for the immediate response.
Yes, I have the dll in the directory in my classpath.
I am using Windows XP. So, how does LD_LIBRARY_PATH figure here?
Any help would be appreciated.
Thanks. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue Jun 12, 2007 6:27 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
|
Back to top |
|
 |
Sarah Lee |
Posted: Tue Jun 12, 2007 7:34 am Post subject: |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
That didn't work either. One thing. My code is able to locate the mqjbnd05.dll. When I change its path, it gives the right path in the error.
There is another line after the unsatisfiedLink. - "The specified procedure could not be found" Could it be that something is missing from my dll or am I missing any other dll?
I have 2 other dlls in the lib directory -
mqjbdf02.dll
MQXAi02.dll
I am asking this because the other errors reported in this forum have a "cannot find dll in library path" or similar such problems after the unsatisfiedLink error. |
|
Back to top |
|
 |
vennela |
Posted: Tue Jun 12, 2007 8:04 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Did you add the path to where the dll is to the PATH variable?
From a command prompt : "echo %PATH%" and paste it here |
|
Back to top |
|
 |
Sarah Lee |
Posted: Tue Jun 12, 2007 8:44 am Post subject: |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
Yes.
C:\Program Files\IBM\WebSphere Q\Java\lib;c:\mqclient\BIN;C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IBM\Infoprint Select;C:\Notes;C:\Program Files\XLView;C:\lotus\compnent;
C:\Utilities;C:\Program Files\ThinkPad\ConnectUtilities;C:\WINDOWS\Downloaded Pr
ogram Files;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\T
race Facility\;C:\Program Files\IBM\WebSphere MQ\Tools\Java\base;C:\Program File
s\IBM\WebSphere MQ\Java\lib\;.;C:\Program Files\IBM\WebSphere MQ\bin;%MQ_JAVA_IN
STALL_PATH%;C:\Program Files\IBM\WebSphere MQ\Java\lib\;;C:\Program Files\IBM\We
bSphere MQ\log;;;C:\Program Files\IBM\WebSphere MQ\bin;C:\Program Files\IBM\WebS
phere MQ\tools\c\samples\bin;C:\Program Files\IBM\WebSphere MQ\Tools\Java\base;C
:\Program Files\IBM\WebSphere MQ\Java\lib\;.;C:\Program Files\IBM\WebSphere MQ\b
in;%MQ_JAVA_INSTALL_PATH%;C:\Program Files\IBM\WebSphere MQ\Java\lib\;;C:\Progra
m Files\IBM\WebSphere MQ\log;;;C:\Program Files\IBM\WebSphere MQ\Java\lib\;C:\Pr
ogram Files\IBM\WebSphere MQ\Tools\Java\base;C:\Program Files\IBM\WebSphere MQ\J
ava\lib\;.;C:\Program Files\IBM\WebSphere MQ\bin;C:\Program Files\IBM\WebSphere
MQ\;;C:\Program Files\IBM\WebSphere MQ\Java\lib\;;C:\Program Files\IBM\WebSphere
MQ\log;;;C:\Program Files\maven-2.0.6\bin\ |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 12, 2007 1:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sarah Lee wrote: |
That didn't work either. One thing. My code is able to locate the mqjbnd05.dll. When I change its path, it gives the right path in the error.
There is another line after the unsatisfiedLink. - "The specified procedure could not be found" Could it be that something is missing from my dll or am I missing any other dll?
I have 2 other dlls in the lib directory -
mqjbdf02.dll
MQXAi02.dll
I am asking this because the other errors reported in this forum have a "cannot find dll in library path" or similar such problems after the unsatisfiedLink error. |
Could it be that you have a mixed version of the client/Server? or different CSDs? _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 1:22 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Could it be all those spaces in the PATH?
Could it be that you didn't install the full MQ client, just a partial install?
Could it be that you're trying to create a bindings connection from a Client install? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jeevan |
Posted: Wed Jun 13, 2007 6:17 pm Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
can u post the follwoing :
mq version on both machine - the one u are running yoru app and the one you are connecting
have you installed the mq from the same source?
have u applied same fp?
can you post your code? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 13, 2007 8:37 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jefflowrey wrote: |
Could it be that you're trying to create a bindings connection from a Client install? |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jun 14, 2007 12:22 am Post subject: Re: Exception in thread "main" java.lang.Unsatisfi |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vitor wrote: |
Also what kind of connection are you trying to establish? |
_________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sarah Lee |
Posted: Thu Jun 14, 2007 8:31 am Post subject: |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
I have MQServer 5.3
Its a BINDING connection.
I have MQServer on my Windows XP machine. So, I am NOT connecting to any other machine. |
|
Back to top |
|
 |
Sarah Lee |
Posted: Fri Jun 15, 2007 6:21 am Post subject: |
|
|
Newbie
Joined: 12 Jun 2007 Posts: 7
|
Reinstalling MQServer resolved the problem. Thanks a lot for your help. |
|
Back to top |
|
 |
|