InitialContext ic = new InitialContext(); 改成: Hashtable ht = new Hashtable(); ht.put(ctx.PROVIDER_URL, "t3://远程ip:端口" ); ht.put(ctx.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); ic = new InitialContext(ht);
加上下面的: Properties h = new Properties(); h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); h.put(Context.PROVIDER_URL, "t3://localhost:7001");
改成:
Hashtable ht = new Hashtable();
ht.put(ctx.PROVIDER_URL, "t3://远程ip:端口" );
ht.put(ctx.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ic = new InitialContext(ht);
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
明天我找个地方把源码放上去。
这回我把我的代码放到网上:session bean和jsp源码:
http://learn.tsinghua.edu.cn/homepage/037821/app/cvt2/src.rarapplication client源码:
http://learn.tsinghua.edu.cn/homepage/037821/app/cvt2/srcClient.rar发布后的ear:
http://learn.tsinghua.edu.cn/homepage/037821/app/cvt2/cvt2.ear发布后生成的客户存根jar:
http://learn.tsinghua.edu.cn/homepage/037821/app/cvt2/cvt2Client.jar