Consultor Eletrônico



Kbase 21388: SonicMQ: JMSException Message for Connection Consumer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   06/05/2003
SUMMARY:

This Solution applies to SonicMQ Version 3.5. It discusses the
following exception and how to resolve it:

javax.jms.JMSException:
The session and the connection consumer must be created
from the same connection.

EXPLANATION:

Creating a

javax.jms.XATopicSession from a javax.jms.XATopicConnection
using the method createXATopicSession()
and using the
javax.jms.TopicSession to get with the method:

getTopicSession() from the javax.jms.XATopicSession
within a javax.jms.ServerSession of a javax.jms.ServerSessionPool

gives the following stack trace as soon as a message arrives for the
MessageListener set for the TopicSession :

javax.jms.JMSException: The session and the connection consumer must
be created from the same connection
at java.lang.Throwable.<init>(Throwable.java:96)
at java.lang.Exception.<init>(Exception.java:44)
at javax.jms.JMSException.<init>(JMSException.java:62)
at
progress.message.jclient.aspi.ConnectionConsumer$IHandler.handleMessa
ge(Unknown Source)
at
progress.message.zclient.MessageHandler.doNextWorkItem(Unknown Source
)
at
progress.message.zclient.SessionMessageProcessor.threadMain(Unknown S
ource)
at progress.message.zclient.DebugThread.run(Unknown Source)

SOLUTION:

Using the javax.jms.XATopicSession instead of the TopicSession
as session object for the javax.jms.ServerSession solves the problem.


References to Written Documentation:

SonicMQ API Reference