EJB3客户端查找 [英] EJB3 Client Lookup
问题描述
我正在尝试从独立的Java客户端调用EJB,并收到以下错误.
I am trying to invoke a EJB from a standalone Java client, getting the below error.
查找代码
String localJNDIName = "ejbremote:gcmsnew/gcmsutilbeans.jar/CustomerSurveyManageQstBean#com.smbcgroup.gcms.utility.bl.survey.CustomerSurveyManageQstRemote";
InitialContext ic = new InitialContext();
GCMSBaseRemote bean = (GCMSBaseRemote)ic.lookup(localJNDIName);
例外
javax.naming.ConfigurationException:NamingManager.getURLContext 找不到适合该方案的工厂:ejbremote at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:471) 在com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160)处 com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)位于 javax.naming.InitialContext.lookup(未知源),网址为 com.test.EJBClientTest.main(EJBClientTest.java:18)
javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: ejbremote at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:471) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) at javax.naming.InitialContext.lookup(Unknown Source) at com.test.EJBClientTest.main(EJBClientTest.java:18)
环境
RAD 7.5,EJB3. Websphere Application Server 7.0.
RAD 7.5, EJB3. Websphere Application Server 7.0.
推荐答案
ejbremote方案在WebSphere Application Server中不存在(即使确实存在"ejblocal").尝试使用 ejb/前缀而不是 ejbremote:.
The ejbremote scheme does not exist in WebSphere Application Server (even though "ejblocal" does exist). Try using a ejb/ prefix instead of ejbremote:.
For more information, see the EJB application bindings overview topic in the InfoCenter.
这篇关于EJB3客户端查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!