Author |
Message
|
dhs |
Posted: Wed Jul 19, 2006 7:46 am Post subject: com.ibm.mq.jms.MQQueueSession - notserializable error |
|
|
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 |
|
 |
mvic |
Posted: Wed Jul 19, 2006 8:00 am Post subject: Re: com.ibm.mq.jms.MQQueueSession - notserializable error |
|
|
 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 |
|
 |
dhs |
Posted: Wed Jul 19, 2006 1:17 pm Post subject: Re: com.ibm.mq.jms.MQQueueSession - notserializable error |
|
|
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 |
|
 |
fjb_saper |
Posted: Wed Jul 19, 2006 2:25 pm Post subject: |
|
|
 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 |
|
 |
8davitt |
Posted: Fri Jul 21, 2006 4:37 am Post subject: |
|
|
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 |
|
 |
dhs |
Posted: Fri Jul 21, 2006 5:46 am Post subject: |
|
|
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 |
|
 |
|