且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用HornetQ ConnectionFactory通过JNDI从EAR启动JBoss时出现NameNotFoundException

更新时间:2023-02-22 19:44:46

昨天我刚遇到此问题,该问题是由JBoss在注册ConnectionFactory和Queues之前启动您的应用程序引起的.

I encountered just this problem yesterday, the problem is caused by JBoss starting your application before it has registered the ConnectionFactory and Queues.

我发现我的应用程序是从Eclipse完美部署的,它一直等到JBoss启动之后再部署.

I found my application deployed perfectly from Eclipse which waits until after JBoss has started before deploying.

解决方案是修改server/{node}/deploy/jbossweb.sar/META-INF/jboss-beans.xml文件,在WebServer bean中添加以下内容.

The solution is to modify the server/{node}/deploy/jbossweb.sar/META-INF/jboss-beans.xml file adding the following within the WebServer bean.

<depends>org.hornetq:module=JMS,name="NettyConnectionFactory",type=ConnectionFactory</depends>
<depends>org.hornetq:module=JMS,name="InVMConnectionFactory",type=ConnectionFactory</depends>  
<depends>org.hornetq:module=JMS,name="NettyThroughputConnectionFactory",type=ConnectionFactory</depends>

这对我有用,我在这里找到了解决方案: http ://edemmorny.com/2011/10/17/jboss-as-6-startup-connectionfactory-not-bound/

This worked for me and I found the solution here: http://edemmorny.com/2011/10/17/jboss-as-6-startup-connectionfactory-not-bound/