|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ClassNotFoundException when call MQMessage readObject method |
« View previous topic :: View next topic » |
Author |
Message
|
windle |
Posted: Sat Dec 06, 2003 7:15 pm Post subject: ClassNotFoundException when call MQMessage readObject method |
|
|
Newbie
Joined: 06 Dec 2003 Posts: 2
|
I'm using MQ 5.3 in windows. Following are my codesnippet:
int openOptions = 17;
queue = qMgr.accessQueue(qName, openOptions);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options += 0;
MQMessage msg = new MQMessage();
queue.get(msg, gmo);
//bMsg = (BusinessMsg)msg.readObject();
Object o = msg.readObject();
System.out.println("received object type:" + o.getClass().getName());
bMsg = (BusinessMsg)msg.readObject();
queue.close();
Note: send message method successed in other side.
Any help are appreciated, thxs in advance!!! |
|
Back to top |
|
 |
dtauzell |
Posted: Wed Dec 10, 2003 8:16 am Post subject: |
|
|
Apprentice
Joined: 23 May 2002 Posts: 37
|
Usually this is because the class of the object (Business in your case) is not on your local classpath so the readObject fails while trying to de-serialize the object (even when you don't cast it).
Verify the class and all other classes used by that object are in your classpath. |
|
Back to top |
|
 |
windle |
Posted: Wed Dec 10, 2003 5:30 pm Post subject: |
|
|
Newbie
Joined: 06 Dec 2003 Posts: 2
|
Thanks for your reply.
Actually I wrote a helper class which contains the sendMsg and receiveMsg method, the class(as well as related classes) located at WEB-INF/classes. Then I wrote a jsp for testing, the code is like the following:
1. construct a BusinessMsg object
2. send it using the helper class's sendMsg method
3. call the helper class's receiveMsg method
The problem is the sendMsg method execute correctly, but recieveMsg method failed with a ClassNotFoundException. |
|
Back to top |
|
 |
dtauzell |
Posted: Thu Dec 11, 2003 6:35 am Post subject: |
|
|
Apprentice
Joined: 23 May 2002 Posts: 37
|
Can you post the code and/or the stack trace?
-Dave |
|
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
|
|
|
|