ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » ClassNotFoundException when call MQMessage readObject method

Post new topic  Reply to topic
 ClassNotFoundException when call MQMessage readObject method « View previous topic :: View next topic » 
Author Message
windle
PostPosted: Sat Dec 06, 2003 7:15 pm    Post subject: ClassNotFoundException when call MQMessage readObject method Reply with quote

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
View user's profile Send private message
dtauzell
PostPosted: Wed Dec 10, 2003 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message
windle
PostPosted: Wed Dec 10, 2003 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
dtauzell
PostPosted: Thu Dec 11, 2003 6:35 am    Post subject: Reply with quote

Apprentice

Joined: 23 May 2002
Posts: 37

Can you post the code and/or the stack trace?

-Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » ClassNotFoundException when call MQMessage readObject method
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.