Posted on 2010-01-14 21:21
斷點(diǎn) 閱讀(693)
評論(1) 編輯 收藏 所屬分類:
JBoss
我在Jboss5.0下開發(fā)MessageDrivenBean時,遇到了一個小錯誤,提示如下:
javax.naming.NameNotFoundException: QueueConnectionFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
產(chǎn)生這個錯誤,主要是因?yàn)樵贘boss5.0下找不到QueueConnectionFactory。我登陸jboss5.0的http://localhost:8090/jmx-console/,在這個jboss/service=JNDIView/list/Global JNDI Namespace下查找,只有ConnectionFactory!
因此解決辦法有了,把發(fā)送消息的java類中的QueueConnectionFactory修改一下即可,如下:
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("QueueConnectionFactory");
改為-->
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
OK,搞定!
posted @ 2009-03-27 17:56 斷點(diǎn) 閱讀(618) | 評論 (3)