|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java Version? |
« View previous topic :: View next topic » |
Author |
Message
|
sevenfan |
Posted: Thu Jun 19, 2003 10:22 am Post subject: Java Version? |
|
|
Apprentice
Joined: 22 May 2003 Posts: 42
|
I have a simple Java class that I use to place a file on a queue. This works great when I run under JDK 1.4. However, I sent to a co-worker who was unable to get this to run on his machine. I had provided him all of the jar files, as well as the exact command-line I had used to run this on my machine. Everything was the same, except that he is running JDK 1.3.1_02.
I recompiled on my machine using the 1.3 JDK and was able to recreate the problem shown below. Since a NoClassDefFoundError is always classpath related, but my classpath hasn't changed I'm wondering what is different between JDK 1.3 and 1.4 that would cause something like this. I am providing my output below.
Thanks.
C:\Download\Java\MQSeries>C:\jdk1.3.1_03\bin\java -cp ".;com.ibm.mq.jar;connector.jar" mqPutFile Dest_queue QM_Target mqtest.cmd
MQPut Program started
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/xa/
XAException
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:361)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
150)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnec
tion(MQBindingsManagedConnectionFactoryJ11.java:139)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnect
ion(MQBindingsManagedConnectionFactoryJ11.java:157)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
a:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
ctionManager.java:150)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
a:678)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:616)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:393)
at mqPutFile.main(mqPutFile.java:27) |
|
Back to top |
|
 |
vennela |
Posted: Thu Jun 19, 2003 11:00 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
True that no class def found is always a CLASSPATH error. Meaning, it is not able to find the class in any of the jar/zip (or whatever) files that are in the classpath.
In java version "1.4.1_02" I have found the following classes in rt.jar
Code: |
340 Thu Feb 20 12:57:54 CST 2003 javax/transaction/InvalidTransactionExceptio
n.class
342 Thu Feb 20 12:57:54 CST 2003 javax/transaction/TransactionRequiredExcepti
on.class
346 Thu Feb 20 12:57:54 CST 2003 javax/transaction/TransactionRolledbackExcep
tion.class
1275 Thu Feb 20 12:47:54 CST 2003 javax/transaction/xa/XAException.class
1062 Thu Feb 20 12:47:54 CST 2003 javax/transaction/xa/XAResource.class
292 Thu Feb 20 12:47:54 CST 2003 javax/transaction/xa/Xid.class
|
May be they are not there in the previous versions of JDK.
So, you will have to include them.
jta.jar is the file that you need to include to make your program work. This jar file should be in the same directory where com.ibm.mq.jar is.
Hope this helps. |
|
Back to top |
|
 |
sevenfan |
Posted: Thu Jun 19, 2003 12:18 pm Post subject: Yup |
|
|
Apprentice
Joined: 22 May 2003 Posts: 42
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|