JMS IlegalStateException when attempting to use Spring SingleConnectionFactory
retrieved from JNDI
--------------------------------------------------------------------------------------------------
Key: CXF-2577
URL: https://issues.apache.org/jira/browse/CXF-2577
Project: CXF
Issue Type: Bug
Components: Transports
Affects Versions: 2.3
Environment: Windows, JDK 1.6
Reporter: Ron Gavlin
A JMS IllegalStateException is thrown when I attempt to use a Spring
SingleConnectionFactory retrieved directly from a local JNDI environment. A
unit test and patch will be attached shortly. The stack trace generated by the
unit test is listed below:
org.springframework.jms.IllegalStateException: setExceptionListener call not
supported on proxy for shared Connection. Set the 'exceptionListener' property
on the SingleConnectionFactory instead. Alternatively, activate
SingleConnectionFactory's 'reconnectOnException' feature, which will allow for
registering further ExceptionListeners to the recovery chain.; nested exception
is javax.jms.IllegalStateException: setExceptionListener call not supported on
proxy for shared Connection. Set the 'exceptionListener' property on the
SingleConnectionFactory instead. Alternatively, activate
SingleConnectionFactory's 'reconnectOnException' feature, which will allow for
registering further ExceptionListeners to the recovery chain.
at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:271)
at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:436)
at
org.apache.cxf.transport.jms.JMSFactory.resolveOrCreateDestination(JMSFactory.java:236)
at
org.apache.cxf.transport.jms.JMSFactory.createJmsListener(JMSFactory.java:216)
at
org.apache.cxf.transport.jms.JMSFactory.createJmsListener(JMSFactory.java:156)
at
org.apache.cxf.transport.jms.JMSDestination.activate(JMSDestination.java:107)
at
org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:48)
at
org.apache.cxf.transport.jms.JMSDestinationTest.setupJMSDestination(JMSDestinationTest.java:102)
at
org.apache.cxf.transport.jms.JMSDestinationTest.testGetSpringSingleConnectionFactoryFromWSDL(JMSDestinationTest.java:550)
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:597)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: javax.jms.IllegalStateException: setExceptionListener call not
supported on proxy for shared Connection. Set the 'exceptionListener' property
on the SingleConnectionFactory instead. Alternatively, activate
SingleConnectionFactory's 'reconnectOnException' feature, which will allow for
registering further ExceptionListeners to the recovery chain.
at
org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:505)
at $Proxy36.setExceptionListener(Unknown Source)
at
org.springframework.jms.connection.SingleConnectionFactory.prepareConnection(SingleConnectionFactory.java:365)
at
org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:291)
at
org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:227)
at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461)
... 30 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.