我在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,搞定!

相关文章:

  • 2021-12-11
  • 2021-12-05
  • 2021-09-20
  • 2022-12-23
  • 2021-07-31
  • 2022-01-02
  • 2021-05-26
猜你喜欢
  • 2021-12-10
  • 2022-01-04
  • 2021-07-01
  • 2021-09-13
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案