I got an error while running certain java code related to JMS. I pulled my hair for 2 days trying to figure it out.
The exception that I get is "java.lang.NoClassDefFoundError: javax / jms / Message"
java.lang.NoClassDefFoundError: javax/jms/Message
at Asci.ActiveBatch.JMSAgent.JMSManager.createMsg(JMSManager.java:195)
at Asci.ActiveBatch.JMSAgent.JMSService.SendMessageHandler(JMSService.java:160)
Without going into the LLP in detail, this applies to this line:
public static void createMsg(String icf, String url, String cf, String QName, String msgText, String[] props, String user, String pass) throws Exception {
JMSProducer.produceMsg(icf, url, cf, QName, msgText, props, user, pass);
}
(Do not ask why this function simply maps to another ... I did not originally write this code)
I call this code as
java -jar /path/myjarfile.jar
javax.jms.jar is included in this jar manifest (and it exists in this place), but just in case, I also tried to include the path to my lib folder (which contains javax.jms.jar, of course) as follows:
java -classpath /path/lib:. -jar /path/myjarfile.jar
. , . . , , ( ) .
.
:
1) java -classpath/path/lib/javax.jms.jar:. -jar/path/myjarfile.jar
2) , .
3) , , jar, . - . , , ( /), . , - - -.