[英]NameNotFoundException when starting JBoss with an EAR using HornetQ ConnectionFactory via JNDI using Spring JMS
I'm trying to deploy an application (EAR) which has Spring JMS listeners, BlazeDS flex and HornetQ in Jboss EAP 6.2.4. 我正在尝试在Jboss EAP 6.2.4中部署一个具有Spring JMS侦听器,BlazeDS flex和HornetQ的应用程序(EAR)。 When I deploy the application and try to start the server, I'm getting the below exception. 当我部署应用程序并尝试启动服务器时,出现以下异常。
Caused by: javax.naming.NameNotFoundException: JmsXA -- service jboss.naming.context.java.JmsXA
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:241)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_80]
at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_80]
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
I saw this thread with similar problem ( https://stackoverflow.com/a/12278834/1326592 ) but this wouldn't work in my case as I dont have a SAR file in my application. 我看到此线程存在类似的问题( https://stackoverflow.com/a/12278834/1326592 ),但由于我的应用程序中没有SAR文件,因此在我的情况下将不起作用。
I'm looking up to the Queues and ConnectionFactory via jee 我正在通过jee查找Queues和ConnectionFactory
<jee:jndi-lookup id="connectionFactory" jndi-name="java:/JmsXA"/>
<jee:jndi-lookup id="RequestsQueue" jndi-name="java:/jms/queue/requestQueue"/>
Please suggest a solution of how to start the HornetQ in Jboss before deploying my application. 在部署我的应用程序之前,请提出一个有关如何在Jboss中启动HornetQ的解决方案。
I found a solution for the above issue. 我找到了上述问题的解决方案。
This got resolved after referring to the JNDI's via resource-ref in web.xml 通过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>
and referring to the resource-ref in my spring.xml as 并在我的spring.xml中引用resource-ref为
<jee:jndi-lookup id="connectionFactory" jndi-name="connectionFactory"/>
<jee:jndi-lookup id="requestsQueue" jndi-name="requestQueue"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.