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 » com.ibm.mq.jms.MQQueueSession - notserializable error

Post new topic  Reply to topic
 com.ibm.mq.jms.MQQueueSession - notserializable error « View previous topic :: View next topic » 
Author Message
dhs
PostPosted: Wed Jul 19, 2006 7:46 am    Post subject: com.ibm.mq.jms.MQQueueSession - notserializable error Reply with quote

Newbie

Joined: 19 Jul 2006
Posts: 3

Can anyone help with this problem?

I am trying to persist a QueueSession object using HttpSession. When I do so I get the following exception: "java.io.NotSerializableException: com.ibm.mq.jms.MQQueueSession"
The QueueSession object is actually persisted and I am able to retrieve it with getAttribute. But the error is very annoying, and I cannot catch it as it is thrown in lower level code. Any thoughts on how to fix this?

Thanks,
David.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Jul 19, 2006 8:00 am    Post subject: Re: com.ibm.mq.jms.MQQueueSession - notserializable error Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Each Session (including QueueSession) encapsulates a connection to the queue manager. What does it mean to persist a connection to the queue manager? If you want a connection you have to call the relevant methods to get one afresh. And these methods only succeed if a number of factors are present and correct: eg. the queue manager needs to be running, and your userid needs to be authorized etc.

Since you say Java allowed you to persist the object to disk, I wonder what happens when you start a new app, deserialize the object and try to (say) create a MessageConsumer?

If this works I will be amazed.
Back to top
View user's profile Send private message
dhs
PostPosted: Wed Jul 19, 2006 1:17 pm    Post subject: Re: com.ibm.mq.jms.MQQueueSession - notserializable error Reply with quote

Newbie

Joined: 19 Jul 2006
Posts: 3

mvic wrote:
Each Session (including QueueSession) encapsulates a connection to the queue manager. What does it mean to persist a connection to the queue manager? If you want a connection you have to call the relevant methods to get one afresh. And these methods only succeed if a number of factors are present and correct: eg. the queue manager needs to be running, and your userid needs to be authorized etc.
>>Yes- agreed.

Since you say Java allowed you to persist the object to disk, I wonder what happens when you start a new app, deserialize the object and try to (say) create a MessageConsumer?

>>Not persisted to disk, but persisted via HttpSession, so can cannect to >>same MQ across different http sessions.
If this works I will be amazed.

>>And it does work. Would like to get rid of the serialization error >>message
from servlet in jboss (4.0.2).
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 19, 2006 2:25 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The only thing you should persist is the connection factory.

It is very bad practice to persist anything beyond the connection as you really need to free the resources.

When ever your session bean gets passivated you should free the MQ resources and reacquire them when the bean gets activated.

Passivation / activation should not be allowed in the same transaction.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
8davitt
PostPosted: Fri Jul 21, 2006 4:37 am    Post subject: Reply with quote

Apprentice

Joined: 06 Feb 2003
Posts: 37
Location: Seated in front of monitor

Quote:
And it does work. Would like to get rid of the serialization error >>message
from servlet in jboss (4.0.2).


MQ JMS is not supported within jboss.

/s
Back to top
View user's profile Send private message
dhs
PostPosted: Fri Jul 21, 2006 5:46 am    Post subject: Reply with quote

Newbie

Joined: 19 Jul 2006
Posts: 3

fjb_saper wrote:
The only thing you should persist is the connection factory.

It is very bad practice to persist anything beyond the connection as you really need to free the resources.

When ever your session bean gets passivated you should free the MQ resources and reacquire them when the bean gets activated.

Passivation / activation should not be allowed in the same transaction.

Enjoy

We have a session timeout that frees up resources when the session times out. FYI - have figured out a fix to the problem. The problem occurs because jboss is trying to serialize the object for clustering. Disabling clustering in the web.xml file causes the error to go away.
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 » com.ibm.mq.jms.MQQueueSession - notserializable error
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.