JBoss:
Properties props = new properties ();
Props. setproperty ("Java. Naming. Factory. Initial", "org. jnp. Interfaces. namingcontextfactory ");
Props. setproperty ("Java. Naming. provider. url", "localhost: 1099 ");
Props. setproperty ("Java. Naming. Factory. url. pkgs", "org. JBoss. Naming ");
WebSphere:
Properties props = new properties ();
Props. setproperty ("Java. Naming. Factory. Initial", "org. openejb. Client. remoteinitialcontextfactory ");
Props. setproperty ("Java. Naming. provider. url", "localhost: 4201 ");
WebLogic:
Properties props = new properties ();
Props. setproperty ("Java. Naming. Factory. Initial ",
"Weblogic. JNDI. wlinitialcontextfactory ");
Props. setproperty ("Java. Naming. provider. url", "T3: // localhost: 7001 ");
Context CTX = new initialcontext (props );
Helloworldremote helloworld = (helloworldremote) CTX. Lookup ("helloworldbean/remote ");
Reference http://hi.baidu.com/winlei/blog/item/90e5a6f0f41d22c47931aaba.html