Forums Register Login

NoClassDefFoundError in jar file

+Pie Number of slices to send: Send
Hi,
I wrote a small MQ/Java program, which I encapsulate in a jar file.
If I include in the jar the com.ibm.mq classes, it works fine. But if I include only the classes that I have wrote, it launches de following exception, when run it:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/MQException
Im sure the PATH and CLASSPATH are ok, because if I execute:
javap com/ibm/mq/MQException
it shows all the methods of the class.
Some help will be apreciated. Thanks
+Pie Number of slices to send: Send
What environment are you running your program in? It sounds as though the environment your running in does not the com/ibm/mq/MQException class in *its* classpath. For instance, you'll often have a situation where you system classpath allows you to compile fine but when run in a web server, the server cannot find some classes. This is because the web server starts up and uses it own classpath to initialize it's JVM instance. Just a thought.
Sean
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 6149 times.
Similar Threads
WAS 6.1 and MQ 6.0 , Exception MQ resource discovery classes are not available
MQWebsphere(MQJE001: An MQException occurred: Completion Code 2, Reason 2059)
java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION
webSphere MQ problem
Passing cmd line arg to Jar
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:52:58.