Glassfish3.1中openMq的调用

gegaosong 2011-05-24 03:25:51
公司现在用Glassfish中集成的openMq作为消息中间件,我在Glassfish中配置好了,然后测试,异常为
javax.naming.CommunicationException: Failed to get registry service for URL: rmi://localhost:7676/ [Root exception is java.rmi.ConnectIOException: Failed to create connection; nested exception is:
org.exolab.jms.net.connector.ConnectException: Failed to lookup connection proxy, host=localhost, port=7676]
at org.exolab.jms.jndi.InitialContextFactory.getInitialContext(InitialContextFactory.java:146)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at QueueSend.main(QueueSend.java:18)
Caused by: java.rmi.ConnectIOException: Failed to create connection; nested exception is:
org.exolab.jms.net.connector.ConnectException: Failed to lookup connection proxy, host=localhost, port=7676
at org.exolab.jms.net.orb.Locator.getProxy(Locator.java:137)
at org.exolab.jms.net.orb.Locator.getRegistry(Locator.java:103)
at org.exolab.jms.net.orb.DefaultORB.getRegistry(DefaultORB.java:285)
at org.exolab.jms.client.net.SharedORB.getRegistry(SharedORB.java:121)
at org.exolab.jms.jndi.InitialContextFactory.getInitialContext(InitialContextFactory.java:144)
... 5 more
Caused by: org.exolab.jms.net.connector.ConnectException: Failed to lookup connection proxy, host=localhost, port=7676
at org.exolab.jms.net.rmi.RMIManagedConnection.<init>(RMIManagedConnection.java:160)
at org.exolab.jms.net.rmi.RMIManagedConnectionFactory.createManagedConnection(RMIManagedConnectionFactory.java:99)
at org.exolab.jms.net.connector.DefaultConnectionPool.createManagedConnection(DefaultConnectionPool.java:233)
at org.exolab.jms.net.connector.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:140)
at org.exolab.jms.net.connector.AbstractConnectionFactory.getConnection(AbstractConnectionFactory.java:167)
at org.exolab.jms.net.connector.AbstractConnectionManager.getConnection(AbstractConnectionManager.java:208)
at org.exolab.jms.net.orb.Locator.getProxy(Locator.java:131)
... 9 more






对应的抛异常的代码
//取得JNDI上下文和连接
Hashtable properties = new Hashtable();
properties.put(
Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");
//openJms默认的端口是1099
properties.put(Context.PROVIDER_URL,
"rmi://localhost:1099/");
Context context = new InitialContext(properties);


之前自己单独做OpenJms没有什么问题,很正常,现在集成Glassfish中的OpenMq不行,默认端口改成7676也没有用,
高手帮帮忙,谢拉
...全文
175 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

25,985

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧