使用Spring JMS通过JNDI使用HornetQ ConnectionFactory使用EAR启动JBoss时的NameNotFoundException

时间:2015-10-28 09:20:35

标签: spring jboss hornetq

我正在尝试部署一个应用程序(EAR),它在Jboss EAP 6.2.4中有Spring JMS监听器,BlazeDS flex和HornetQ。当我部署应用程序并尝试启动服务器时,我得到以下异常。

table_4

我看到这个帖子有类似的问题(https://stackoverflow.com/a/12278834/1326592),但这不适用于我的情况,因为我的应用程序中没有SAR文件。

我正在通过jee

查找Queues和ConnectionFactory
t4_id

请在部署我的应用程序之前建议如何在Jboss中启动HornetQ的解决方案。

1 个答案:

答案 0 :(得分:0)

我找到了上述问题的解决方案。

在通过web.xml

中的resource-ref引用JNDI后,这个问题得到了解决
<resource-ref id="ItftRequestsQueue">
    <res-ref-name>requestQueue</res-ref-name>
    <res-type>javax.jms.Queue</res-type>
    <res-auth>Container</res-auth>
    <lookup-name>java:/jms/queue/requestQueue</lookup-name>
</resource-ref>

和 将spring.xml中的resource-ref称为

<jee:jndi-lookup id="connectionFactory" jndi-name="connectionFactory"/>
<jee:jndi-lookup id="requestsQueue" jndi-name="requestQueue"/>