首先你要获得发布session Bean的weblogic服务器的jndi
t3://127.0.0.1:7001应该为那台机器的IP地址
然后根据jndi获取远程接口就可以了try{
Properties pro = new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
pro.put(Context.PROVIDER_URL, "t3://127.0.0.1:7001");
return new InitialContext(pro);
}catch(Exception ep)
{
ep.printStackTrace();
return null;
}
t3://127.0.0.1:7001应该为那台机器的IP地址
然后根据jndi获取远程接口就可以了try{
Properties pro = new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
pro.put(Context.PROVIDER_URL, "t3://127.0.0.1:7001");
return new InitialContext(pro);
}catch(Exception ep)
{
ep.printStackTrace();
return null;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货