Java 从Jboss 5.1 EJB访问Jboss 7.1 EJB
我还有一个问题,非常感谢您的帮助: Jboss 7.1中运行着一个EJB,需要从运行在Jboss 5.1上的另一个EJB访问它 我已经按照几页的说明做了。在Jboss 7.1中,我通过一个普通java类获得了与ejb的通信:Java 从Jboss 5.1 EJB访问Jboss 7.1 EJB,java,eclipse,jakarta-ee,jboss,Java,Eclipse,Jakarta Ee,Jboss,我还有一个问题,非常感谢您的帮助: Jboss 7.1中运行着一个EJB,需要从运行在Jboss 5.1上的另一个EJB访问它 我已经按照几页的说明做了。在Jboss 7.1中,我通过一个普通java类获得了与ejb的通信: final Properties jndiProperties = new Properties(); jndiProperties.put("java.naming.factory.initial","org.jboss.naming.remote
final Properties jndiProperties = new Properties();
jndiProperties.put("java.naming.factory.initial","org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(InitialContext.PROVIDER_URL, "remote://127.0.0.1:4448");
jndiProperties.put("jboss.naming.client.ejb.context", true);
//jndiProperties.put(Context.SECURITY_PRINCIPAL, "client");
//jndiProperties.put(Context.SECURITY_CREDENTIALS, "password");
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
return (BeanRemoteInterface) context.lookup(LOOKUP_STRING);
(我已将缺陷端口4447更改为4448,并取消了领域安全子系统的激活,因此现在不需要用户和通行证)
然而,当我在JBoss5.1中尝试从ejb进行通信时,它不起作用。我对InitialContext的创建进行了更改,经过多次测试,我发现了一个无法解决的错误:
12:15:13,219 ERROR [STDERR] javax.naming.CommunicationException: Could not obtain connection to any of these urls: remote://127.0.0.1:4448 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server remote://127.0.0.1:4448:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server remote://127.0.0.1:4448:1099 [Root exception is java.net.UnknownHostException: remote://127.0.0.1:4448]]]
顺便说一句!!!JBoss7.1使用-B0.0.0.0运行,所以这不是问题所在
提前谢谢