Posted on 2010-01-14 21:21
斷點 閱讀(692)
評論(1) 編輯 收藏 所屬分類:
JBoss
我在Jboss5.0下開發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)
產生這個錯誤,主要是因為在Jboss5.0下找不到QueueConnectionFactory。我登陸jboss5.0的http://localhost:8090/jmx-console/,在這個jboss/service=JNDIView/list/Global JNDI Namespace下查找,只有ConnectionFactory!
因此解決辦法有了,把發送消息的java類中的QueueConnectionFactory修改一下即可,如下:
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("QueueConnectionFactory");
改為-->
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
OK,搞定!
posted @ 2009-03-27 17:56 斷點 閱讀(618) | 評論 (3)