当前位置: 首页 > 知识库问答 >
问题:

此容器中不允许使用方法setExceptionListener

阚原
2023-03-14

我试图让当前的Spring应用程序与WebSphere7默认JMS提供程序一起工作。我已经创建了一个总线,并用它分配了一个队列,还有一个SIB QueueConnectionFactory、一个SIB队列和一个激活规范,并将其与SIB队列链接起来。我确信应用服务器的消息引擎已启动。

这就是我的网络。xml来引用JNDI资源

<!-- Question: should I define Activation Specification here as well as a resource ? -->
<resource-ref>
    <description>JNDI JMS Conn Factory </description>
    <res-ref-name>jms/ConnectionFactory</res-ref-name>
    <res-type>javax.jms.ConnectionFactory</res-type>
    <res-auth>Container</res-auth>
</resource-ref>
    <resource-ref>
    <description>JNDI JMS Queue </description>
    <res-ref-name>jms/queue/QueueOrderUpdate</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

当我启动应用程序时,它会给我:

Could not refresh JMS Connection for destination 'ORDER.QUEUE' - retrying in 5000 ms. Cause: 
CWSIA0025E: The method setExceptionListener is not permitted in this container.
javax.jms.IllegalStateException: CWSIA0025E: The method setExceptionListener is not permitted 
in this container.

顺序。QUEUE是应用程序从WS中引用的队列:

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="jmsCachingConnectionFactory" />
    <!-- same queue as jms/queue/QueueOrderUpdate -->
    <property name="defaultDestinationName" value="ORDER.QUEUE" />
    <property name="messageConverter" ref="orderMessageConverter"/>
</bean>

而那应该是

<!-- I think this should be the queue defined for the bus but not the SIB queue right? -->
<jee:jndi-lookup id="jmsQueue" jndi-name="jms/queue/QueueOrderUpdate">
    <jee:environment>
        java.naming.provider.url=${java.naming.provider.url}
        java.naming.factory.initial=${java.naming.factory.initial}
        java.naming.factory.url.pkgs=${java.naming.factory.url.pkgs}
    </jee:environment>
</jee:jndi-lookup> 

以下是我的问题:

  1. 如果默认的JMS提供程序是从Webphere中选择的,那么默认情况下它应该是JCA兼容的JMS实现,我假设它应该使用Activation规范适配器而不是侦听器端口?
  2. 如果是这样,那么我应该在web.xml和Spring bean配置中链接激活规范JNDI而不是连接工厂吗?所以web.xml应该有三个,一个用于连接工厂,一个用于队列,一个用于激活规范?
  3. 为什么抛出异常

共有1个答案

缪远
2023-03-14

查看我以前使用WAS7的Spring JMS的项目,我对web中的JNDI一无所知。xml

我对这件事的看法如下:

<bean id="connectionFactory" class="org.springframework.jms.connection.DelegatingConnectionFactory">
    <property name="targetConnectionFactory">
        <jee:jndi-lookup jndi-name="jms/StpConnectionFactory"/>
    </property>
    <property name="shouldStopConnections" value="true"/>
</bean>

<jee:jndi-lookup id="orderQueue" jndi-name="jms/queue/QueueOrderUpdate"/>

我记得我刚刚为连接工厂以及目的地使用了默认JMS提供程序

 类似资料:
  • 问题内容: 我打算使用Ajax将跨域请求发送到soap Web服务。Web服务的URL是:http://example1.asmx?op = GetVOD 我的代码: 在IIS 7服务器端,我已经将这些行添加到文件web.config中 当我在Chrome上运行客户端代码时,出现405错误: 有谁知道如何解决这个问题? 预先感谢 问题答案: 听起来像Web DAV正在阻碍。这是删除它的配置: ht

  • 我有一个restcontroller和post方法,带有以下url和json请求。http://server/member/sc/v1/limited-liability/medicare 使用post方法和json请求在本地触发请求时,获得正确的响应。但在docker中以spring boot应用程序的形式运行会将异常作为不允许的方法抛出。最初,我将这个docker服务部署为put方法。现在我转

  • 我正在尝试使用angularJs和$http发布一个表单。post方法。但每当我执行此函数时,它都会给我以下错误:加载资源失败:服务器响应状态为405(不允许使用方法),我不知道该怎么办。(Im使用visual studio 2015)

  • 我已经编写了这个类以及EventListener注释和一个triggerMail方法—— 但是,在eclipse ide中,它给出了错误此位置不允许注释@EventListener和参数triggerMail的非法修饰符;只允许最终。 如何解决此问题?请帮助。

  • 该代码在我的本地开发环境中运行良好,但在我将其上载到服务器时,给出了一个异常。这个问题和这个问题的解决方案对我不起作用。 这是控制器。 这是routes文件中的相应条目。 这里是对URL的AJAX调用。 这就是示例测试用例的数据。 我如何克服这个错误,为什么这只发生在生产中? 值得注意的是,我在整个应用程序中还有其他对路由的AJAX调用,它们工作得很好。

  • 我得到了405请求方法'GET'在app engine的文件上传过程中不受支持,但在我的本地沙箱中相同的代码运行正常 看起来像bbloservice回调请求应该是POST类型后POST/_ah/上载/...但是当我用Firebug看的时候,它是一个带有以下头的GET请求,我确实在@Controller类中定义了请求处理程序,该类具有方法类型请求方法。POST 标题 响应Headersview源允许