ejb如何穿路由器远程调用
如题,ejb服务和调用服务分别部署在两个服务器的jboss4.4.2.GA容器里,调用服务器在外网,ejb服务器在内网,内网通过路由器上网,此时用调用服务器调用内网的ejb服务器需要如何操作呢?
远程调用ejb的方法如下,当两台服务器都在外网时测试可以通过
Properties properties = new Properties();
properties.setProperty(Context.PROVIDER_URL, “公网ip:1099”);
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context context = new InitialContext(properties);
Object ejb = context.lookup("ejbServiceBean/remote");
现在将ejb服务器放到内网中,在路由器上做端口映射,映射了1098、1099、3873端口,调用服务器调用ejb服务器的公网ip,其他相同,但是始终调用不到,不知是何原因?希望有相关经验的大侠不吝赐教,多谢了!