你的测试端有问题,如果是weblogic的话,要加上
String url = "t3://wangqiang:7001";
String user = null;
String password = null;
Properties properties = null;
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
Context context = new InitialContext(properties);
//look up jndi name
Object ref = context.lookup("...");
...
String url = "t3://wangqiang:7001";
String user = null;
String password = null;
Properties properties = null;
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
Context context = new InitialContext(properties);
//look up jndi name
Object ref = context.lookup("...");
...
Context.INITIAL_CONTEXT_FACTORY
"com.ibm.websphere.naming.WsnInitialContextFactory "
Context.PROVIDER_URL
"iiop://localhost:900 "
Weblogic:
Context.INITIAL_CONTEXT_FACTORY
"weblogic.jndi.WLInitialContextFactory "
Context.PROVIDER_URL
"t3://127.0.0.1:7001 "
J2EE SDK(J2EE RI):
Context.INITIAL_CONTEXT_FACTORY
"com.sun.jndi.cosnaming.CNCtxFactory "
Context.PROVIDER_URL
"iiop://127.0.0.1:1050 "
SilverStream:
Context.INITIAL_CONTEXT_FACTORY
"com.sssw.rt.jndi.AgInitCtxFactory "
Context.PROVIDER_URL
"sssw://localhost:80 "
OC4J
Context.INITIAL_CONTEXT_FACTORY
"com.evermind.server.rmi.RMIInitialContextFactory"
Context.PROVIDER_URL
"ormi://127.0.0.1/"
JBOSS的:
java.naming.factory.initial
"org.jnp.interfaces.NamingContextFactory"
java.naming.provider.url
"localhost:1099"
WAS5:
Context.INITIAL_CONTEXT_FACTORY
"com.ibm.websphere.naming.WsnInitialContextFactory "
Context.PROVIDER_URL
"iiop://localhost:2809 "
------------------------------------------------------
我们还年轻牛奶会有的奶牛也会有的
可天天在 csdn 混这些会有吗 ??
java.io.NotSerializableException: sample.ejb.session.LoginSessionBean_ugujnx_LocalHomeImpljava.io.NotSerializableException: sample.ejb.session.LoginSessionBean_ugujnx_LocalHomeImpl <<no stack trace available>>