properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); properties.put(Context.PROVIDER_URL, t3://你的IP:7001); //look up jndi name Object ref = context.lookup("UsersRemote"); //look up jndi name and cast to Home interface usersHome = (UsersHome) PortableRemoteObject.narrow(ref, UsersHome.class); 这样找不到吗?报什么错?
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, t3://你的IP:7001);
//look up jndi name
Object ref = context.lookup("UsersRemote");
//look up jndi name and cast to Home interface
usersHome = (UsersHome) PortableRemoteObject.narrow(ref, UsersHome.class);
这样找不到吗?报什么错?
可以使用 <ejb-ref>, link名称为<jar文件名#ejb名>如果这两JAR不在一个应用中,通过JNDI访问。