67,513
社区成员
发帖
与我相关
我的任务
分享
package helloworld;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
public class HelloClient {
public static void main(String[] args) throws Exception{
Properties props=System.getProperties();
Context ctx=new InitialContext(props);
Object obj=ctx.lookup("examples.ejb21.HelloHome");
HelloHome home=(HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello=home.create();
System.out.println(hello.hello());
hello.remove();
}
}