On 18/01/2008, JS75 <[EMAIL PROTECTED]> wrote: > > Dear All: > I tried to receive message from topic, however, I got exception below. > [java] [java] javax.jms.IllegalStateException: Cannot > synchronously receive a message when a MessageListener is set > [java] [java] at > org.apache.activemq.ActiveMQSession.checkMessageListener(ActiveMQSession.java:1723) > [java] [java] at > org.apache.activemq.ActiveMQMessageConsumer.checkMessageListener(ActiveMQMessageConsumer.java:631) > [java] [java] at > org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:468) > > In my code, I initital a topic subsrciber to receive a message and set it > with one message listener. > subscriber.setMessageListener(ml); // ml is the message listener > > I have no idea why throws this exception..
As Jonas says - the JMS specification means we have to throw an exception, you can only use sync or async mode on a single consumer -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com