This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Spring-JMS with Glassfish Exception

Dec 3rd, 2012, 08:54 AM

Hi,

I have an application which is built using spring-jms and I am trying to get it to work with Glassfish.

When I deploy my app I get the following exception:

Code:

Caused by: javax.jms.JMSException: MQJMSRA_DC2001: Unsupported:setExceptionListener():inACC=false:connectionId=7397227676621758721
at com.sun.messaging.jms.ra.DirectConnection._unsupported(DirectConnection.java:982)
at com.sun.messaging.jms.ra.DirectConnection.setExceptionListener(DirectConnection.java:505)
at org.springframework.jms.connection.SingleConnectionFactory.prepareConnection(SingleConnectionFactory.java:364)
at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:289)
at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:404)
at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:372)
at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:279)
at org.springframework.jms.listener.SimpleMessageListenerContainer.doStart(SimpleMessageListenerContainer.java:224)
at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:264)

I seem to see some information about the "reconnectOnException" property mentioned in a few places, but the information I find is loose and vague. I have tried setting true and false on it with little effect.

Comment

It seems odd that the provider doesn't support setExceptionListener().

In order to prevent Spring from setting it, you need to remove the "exceptionListener" property on the container, and leave "reconnectOnException" at its default (false).

Gary,

Thanks. I have set the reconnectOnException to false (and also tried ommited), and removed the exceptionListener and that gives me the following exception:

Code:

[#|2012-12-03T15:57:13.249+0000|INFO|glassfish3.1.1|org.glassfish.admingui|_ThreadID=25;_ThreadName=Thread-2
;|Exception Occurred :Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.context.ApplicationContextException:
Failed to start bean 'container'; nested exception is 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.. Please see server.log for more details.|#]

If I do as it says and set the exceptionListener property on the SingleConnectionFactory I get the same exception as the original post.