如何解决Websphere 8.5.5-EJB查找-javax.naming.NameNotFoundException
我正在尝试从我本地环境中位于不同WebSphere 8.5.5 Server实例上的WebApp调用EJB。
-
EJB模块部署在第一台WebSphere 8.5.5服务器上-URL:iiop:// localhost:2818
-
WebApp部署在第二个WebSphere 8.5.5服务器上-可从http:// localhost:9084 /
访问
- 接口:com.package.client.MyAppServiceRemote
- bean企业:MyAppService
- 模块:my-app-ejb.jar
- app:my-app-ear
在EJB模块部署期间,我可以在控制台日志中看到一条消息,指出该绑定是在以下位置创建的:
- ejb / my-app-ear / my-app-ejb.jar / MyAppService#com.package.client.MyAppServiceRemote
- com.package.client.MyAppServiceRemote
- java:global / my-app-ear / my-app-ejb / MyAppService!com.package.client.MyAppServiceRemote
在我的webApp中,我以这种方式进行EJB查找:
Properties props = new Properties();
InitialContext ctx;
String serverUrl = "iiop://localhost:2818";
String jndi = "com.package.client.MyAppServiceRemote";
props.put(Context.INITIAL_CONTEXT_FACTORY,GestoreProperties.getUniqueInstance().getInitialContextFactory());
props.put(Context.PROVIDER_URL,serverUrl);
ctx = new InitialContext(props);
MyAppServiceRemote myAppServiceRemote = (MyAppServiceRemote) ctx.lookup(jndi);
我遇到此错误:
javax.naming.NameNotFoundException:上下文:USERNode05Cell / nodes / USERNode05 / servers / server1,名称:com.package.client.MyAppServiceRemote:找不到名称com.package.client.MyAppServiceRemote中的第一个组件。 [根本例外是org.omg.CosNaming.NamingContextPackage.NotFound:IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
我试图将所有三个名称都设置为jndi
- ejb / my-app-ear / my-app-ejb.jar / MyAppService#com.package.client.MyAppServiceRemote
- com.package.client.MyAppServiceRemote
- java:global / my-app-ear / my-app-ejb / MyAppService!com.package.client.MyAppServiceRemote 但没有人起作用。
如何优化EJB的确切jndi名称? 很多thaks
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。