Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 此容器中不允许使用方法setExceptionListener_Spring_Jms_Websphere_Spring Jms - Fatal编程技术网

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

Spring 此容器中不允许使用方法setExceptionListener,spring,jms,websphere,spring-jms,Spring,Jms,Websphere,Spring Jms,我试图使当前的Spring应用程序与WebSphere7默认JMS提供程序一起工作。我已经创建了一个总线并分配了一个队列,还有一个SIB QueueConnectionFactory、一个SIB队列和一个激活规范,并将其与SIB队列链接起来。我确信应用服务器的消息引擎已启动 因此,这里有我的web.xml来引用JNDI资源 <!-- Question: should I define Activation Specification here as well as a resource ?

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

因此,这里有我的web.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>
ORDER.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> 

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}
它应该是我在Websphere中定义的队列:

以下是我的问题:

  • 如果默认JMS提供程序是从Websphere中选择的,那么默认情况下,它应该是符合JCA的JMS实现,并且我假设它应该使用
    激活规范
    适配器,而不是侦听器端口
  • 如果是这样,那么我应该链接web.xml中的激活规范JNDI和Springbean配置,而不是连接工厂吗?所以web.xml中应该有三个,一个用于ConnectionFactory,一个用于队列,一个用于激活规范
  • 为什么抛出异常
  • 更新: 我发现没有侦听器端口绑定到当前服务器,请查看以下屏幕截图:

    查看我以前使用SpringJMS的WAS7项目,我在
    web.xml
    中没有关于JNDI的任何信息

    我对此事的spring配置如下所示:

    <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提供程序
    用于
    连接工厂
    ,以及
    目的地
    s.

    感谢您的回复,这是我的荣幸:)。那么,在您的旧项目中,是否存在与WebSphere7中的激活规范相关的内容?听起来好像
    不需要web.xml?M-M-M中的任何内容。对我来说,似乎MDB需要
    激活规范
    。不是吗?是的,没错。实际上,我从未在
    web.xml
    中使用过
    :JBOSS、WAS、WebLogic。所有的环境对我来说都很好。谢谢,很方便。您能回忆一下我们可以避免为JMS jndi定义哪个版本的Spring吗?Spring3.2是否合格?您是在应用程序中尝试发送、接收还是同时发送和接收?@Gas是的。同一应用程序中有发送器和接收器模块。我对是否需要为这个应用程序注册激活规范感到困惑。示例没有提到它,但我尝试了该示例,然后得到:CWSIA0005E:JCA运行时未能分配连接,似乎从一开始就找不到消息引擎……您不能使用普通的EJB MDB进行接收吗?您还提到了侦听器端口,您在WAS中配置了吗?它们不应用于默认提供程序。@这是一个Spring应用程序,但接收部分是pojo MDB。我对端口错误感到非常困惑,因为总线、队列或连接工厂中没有定义端口。我真的不知道WS从何处获取该端口,看起来它通过当前设置标识出“应该”有一个端口。@Gas,我在服务器设置中找到了一些内容,在线程中进行了更新,不确定这是否相关
    <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"/>