unable to unset a message listener by callig setMessageListener(null)
---------------------------------------------------------------------
Key: JBMESSAGING-1717
URL:
https://jira.jboss.org/jira/browse/JBMESSAGING-1717
Project: JBoss Messaging
Issue Type: Bug
Affects Versions: 2.0.0.beta4
Reporter: Jeff Mesnil
Assignee: Jeff Mesnil
Fix For: 2.0.0
calling JBossMessageConsumer.setMessageListener(null) does not unset the message listener
and causes a IllegalStateException when a receive() method is called:
javax.jms.IllegalStateException: Cannot call receive(...) - a MessageHandler is set
at
org.jboss.messaging.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:158)
at
org.jboss.messaging.jms.client.JBossMessageConsumer.getMessage(JBossMessageConsumer.java:219)
at
org.jboss.messaging.jms.client.JBossMessageConsumer.receive(JBossMessageConsumer.java:147)
at
org.jboss.test.messaging.jms.MessageConsumerTest.testSetMessageListenerToNull(MessageConsumerTest.java:2536)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: MessagingException[errorCode=104 message=Cannot call receive(...) - a
MessageHandler is set]
... 20 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira