【发布时间】:2016-03-01 15:41:03
【问题描述】:
使用 spring CachingConnectionFactory 连接到 WAS 上的 Websphere MQ 时出现以下错误
org.springframework.jms.IllegalStateException: **Method setExceptionListener not permitted;** nested exception is javax.jms.IllegalStateException: Method setExceptionListener not permitted
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:279) ~[spring-jms-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169) ~[spring-jms-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:496) ~[spring-jms-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:568) ~[spring-jms-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:559) ~[spring-jms-4.1.5.RELEASE.jar:4.1.5.RELEASE]
我的配置看起来像 -
<jee:jndi-lookup id="jmsConnectionFactory"
jndi-name="jms/XXXCF" />
<bean id="cachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="jmsConnectionFactory"/>
<property name="sessionCacheSize" value="50" />
</bean>
<bean id="jmsResponseTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="cachedConnectionFactory" />
<property name="defaultDestination" ref="XXXQueue" />
</bean>
有谁知道我是否缺少 spring 或 WAS 方面的任何配置?提前致谢。
【问题讨论】: