Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to resolve java.lang.ClassCatException

55 views
Skip to first unread message

iwant...@gmail.com

unread,
Mar 10, 2009, 1:14:48 AM3/10/09
to
Hi Im using WAS 6.1.0.21 and WebSphere MQ 6.0. Whenever my application tries to execute *createQueueConnection()* statement, it throws ClassCastException.
The SystemOut.logs are as follows:
java.lang.ClassCastException: java.lang.UnsatisfiedLinkError incompatible with java.lang.Exception

The SystemErr.log are as follows:
java.lang.UnsatisfiedLinkError: mqjbnd05 (Not found in java.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:986)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:950)
at java.lang.System.loadLibrary(System.java:453)
at com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:1028)
at com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:246)
at java.security.AccessController.doPrivileged(AccessController.java:197)
at com.ibm.mq.server.MQSESSION. (MQSESSION.java:243)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:508)

java.lang.NoClassDefFoundError: com.ibm.mq.server.MQSESSION (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:132)
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:508)
at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:213)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:186)

Im really stuck up with this pblm and need an urgent solution.
Thanks in advance.

Ken Hygh

unread,
Mar 10, 2009, 8:55:22 AM3/10/09
to

UnsatisfiedLinkError means that the named shared library (mqjbnd05.so or
.dll) is not on the process's PATH. Easiest way to fix this is to create
a shared library containing the above file, and add a classloader to
your server with this shared library.

Ken

and...@us.ibm.com

unread,
Mar 10, 2009, 10:10:46 AM3/10/09
to
Do you have the stack trace for the ClassCastException? I would guess that there is some logic somewhere that is catching the UnsatisfiedLinkError and trying to cast it to a java.lang.Exception. Instead, it should probably cast it to a java.lang.Throwable or create a new Exception and pass the UnsatisfiedLinkError as the cause. UnsatisfiedLinkErrors do not inherit from Exception, they inherit from Error (both Exception and Error inherit from Throwable so one cannot be casted to another).

It looks like the root of the problem is due to a missing native library for MQ. Because WAS cannot find this native library, it cannot complete the initialization of the MQSESSION class. This sounds like it would prevent MQ from working at all. I'm not MQ expert, but you could probably resolve this problem by including the MQ libraries in the native classpath for WAS.

Hope this helps,

Andy

LEMI...@uk.ibm.com

unread,
Mar 11, 2009, 1:19:44 PM3/11/09
to
Hi.

Assuming you are trying to create a bindings mode connection you need to set the MQ_INSTALL_ROOT variable. If you search for MQ_INSTALL_ROOT in the forums you will get the instructions you need. Alternatively use a client mode connection.

Cheers, Matt.

iwant...@gmail.com

unread,
Mar 27, 2009, 7:13:59 AM3/27/09
to
Hi,
I created a Websphere variable at server scope ie MQ_INSTALL_ROOT and pointed the instrallation path of mqm.
This resolved the problem.
Thanx alot.
0 new messages