import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import com.jndi.test.WorkerRemote; public class Main { public static void main(String[] args) throws NamingException { System.setProperty("com.sun.appserv.iiop.endpoints", "localhost:3700"); System.out.println("Property:"+System.getProperty("com.sun.appserv.iiop.endpoints")); System.out.println("==========>start: "); Context ctx = new InitialContext(); System.out.println("begin: "); WorkerRemote wr = null; Context ctx2 = (Context) ctx.lookup("ejb"); wr = (WorkerRemote) ctx2.lookup("worker01"); // wr = (WorkerRemote) ctx.lookup("ejb/worker01"); System.out.println(wr.work()); } }