0
我正在使用jboss-5.0.1 GA。 我正在尝试使用JNDI从本地EJB调用部署在远程JBoss服务器上的EJB。无法从本地EJB进行远程JNDI调用
我已将远程接口jar文件包含在本地EJB项目的类路径中。我还在我的类路径中添加了jnp-client.jar,jboss-ejb3-client.jar。
我使用-b 0.0.0.0标志在远程计算机上启动了JBoss,以确保它接受远程连接。
这是代码。
SatheBeanRemote sbr = null; //Is the remote interface for the remote bean
Properties p = new Properties();
p.put(Context.PROVIDER_URL, "jnp://10.73.17.76:1099"); //remote Jboss IP
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
Context context;
try {
context = new InitialContext(p);
sbr = (SatheBeanRemote) context.lookup("RemoteEAR/SatheBean/remote");
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我得到以下例外。
任何人都可以帮我指出这个问题吗?
看起来像你的应用程序无法看到的.jar与您导入到项目中的EJB接口。查看您用于部署的.ear文件的结构会很有用。 –