EJB调用远程EJB
javan 2008-01-15 11:21:45 有两台weblogic服务器,现在想在其中一台服务器上写一个EJB来调用另一台服务器jndi名为“LOGIN”的EJB。但是调试了很久没有调通,老是提示找不到服务。
其中EJB调用远程EJB的代码片段:
AgentHome home = null;
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
props.put(Context.PROVIDER_URL, "t3://132.1.18.11:91");
InitialContext remoteCtx = new InitialContext(props);
Object ref = remoteCtx.lookup("LOGIN");
home = (AgentHome) PortableRemoteObject
.narrow(ref, AgentHome.class);
Agent remote = home.create();
return (String) remote.referApply(sxml);
是不是EJB内要调用远程EJB在部署文件ejb-jar.xml或者在web.xml文件要设置的。还是其他的错误。。
请各位大侠请教!!!!!