You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by James Strachan <ja...@yahoo.co.uk> on 2003/03/18 15:12:52 UTC

[messenger] Re: IllegalStateException on Websphere 5.0

There is a limitation in WebSphere 5.0 where asynchronous subscription
cannot be done from inside a Servlet.

To work around this you need to create a Thread to consume messages using
the receive() method instead.

You can do this via the subscription.xml by adding the <consumerThread>
element. e.g.

<subscriptions>
    <subscription connection="connectionName" subject="destinationName">
        <listener className="theNameOfTheListenerClass"/>

        <!-- use synchronous subscription />
        <consumerThread/>
    </subscription>
</subscriptions>

James
-------
http://radio.weblogs.com/0112098/

----- Original Message -----
From: Harish Sidlaghatta
To: jstrachan@apache.org
Sent: Tuesday, March 18, 2003 11:23 AM
Subject: IllegalStateException on Websphere 5.0


Hi,
We had been using org.apache.commons.messenger.DefaultMessenger for a JMS
component,
which works fine on WebLogic and Websphere 4.0
While using on Websphere 5.0, an exception is being thrown (at end of
mail)...
Have you faced any such IllegalStateException before, if so what is the
workaround?
Any inputs greatly appreciated,
Thanks,
Harish.


---------------------------------
exception was logged javax.jms.IllegalStateException: Method
setMessageListener not permitted
at
com.ibm.ejs.jms.JMSCMUtils.methodNotPermittedException(JMSCMUtils.java:200)
at
com.ibm.ejs.jms.JMSMessageConsumerHandle.setMessageListener(JMSMessageConsum
erHandle.java:199)
at org.apache.commons.messenger.MessengerSupport.addListener(Unknown
Source)
at com.ispheres.zen.common.jms.JMSManager.init(JMSManager.java:550)
at
com.ispheres.zen.common.jms.JMSManager.<init>(JMSManager.java:136)
at
com.ispheres.zen.event.detector.phase.EventDetectorThread.run(EventDetectorT
hread.java:170)




Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com