ejb client

winsome_zhong 2001-07-02 03:47:45
如何用jndi来定位ejb?

...
Properties p=new Properties();
p.put(...);
return new javax.naming.InitialContext(p);
如果appserver是weblogic,上面的put()语句为
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.TengahInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
那如果是BAS4.5,那put()语句怎么写?webshere呢?

...全文
153 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
hicharlie 2001-07-07
  • 打赏
  • 举报
回复
iiop这一句,可能有误,缺省安装的BAS端口是14000;
String sProviderURL= "iiop://localhost:14000";
实际格式是 iiop://bas安装机器的IP:Bas的port
luodi 2001-07-05
  • 打赏
  • 举报
回复
websphere 4 只支持 EJB1.1
gdsean 2001-07-05
  • 打赏
  • 举报
回复
ejb2.0规范都出来了,
weblogic6支持ejbql,
websphere4可以吗
winsome_zhong 2001-07-05
  • 打赏
  • 举报
回复
java高手其实很少
hicharlie 2001-07-05
  • 打赏
  • 举报
回复
to winsome_zhong(草履虫):
,哈,被你一逼,只有出手了。
String sProviderURL= "iiop://localhost:8080";//这是bas45本地开发的地址,实际过程中与你的配置有关 //String sJNDIFactory= "com.ibm.ejs.ns.jndi.CNInitialContextFactory";
//0.
//Bas Factory
String sJNDIFactory= "com.inprise.j2ee.jndi.CtxFactory";
//JNDI的制造者;
System.out.println("ProviderURL : "+sProviderURL);
try
{
// Get an InitialContext
Properties h= new Properties();
//WebLogic6.0
//h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
//WebSphere
h.put(Context.INITIAL_CONTEXT_FACTORY, sJNDIFactory);
//Borland Application Server
h.put(Context.PROVIDER_URL, sProviderURL);
return new InitialContext(h);
}
catch (NamingException ne)
{
System.out.println(ne);
System.out.println(
"We were unable to get a connection to the WebLogic server at " + sProviderURL);
System.out.println("Please make sure that the server is running.");
//throw ne;
return null;
}
xiaobinliu 2001-07-05
  • 打赏
  • 举报
回复
?
roamer 2001-07-04
  • 打赏
  • 举报
回复
我不知道,我也想要,有哪位兄弟知道。
winsome_zhong 2001-07-04
  • 打赏
  • 举报
回复
roamer:知道哪有下吗?
roamer 2001-07-03
  • 打赏
  • 举报
回复
websphere3.5只支持ejb1.0
不过听说新出的websphere4.0支持ejb1.1,不过没见过.
backlove 2001-07-03
  • 打赏
  • 举报
回复
xixi,我用的是weblogic,bas只在jb4下做过一个,见笑了
winsome_zhong 2001-07-03
  • 打赏
  • 举报
回复
backlove你那是testclient的写法,独立的client是不行的,
roamer请问webshere支持ejb1.1吗?我记得好象只支持1.0,
roamer 2001-07-02
  • 打赏
  • 举报
回复
webshpere上
p.put(Context.PROVIDER_URL,
“iiop://192.168.2.7:900”);
p.put(Context.INITIAL_CONTEXT_FACTORY,
“com.ibm.ejs.ns.jndi.CNInitialContextFactory”);
//192.168.2.7为服务器IP,900为端口号
backlove 2001-07-02
  • 打赏
  • 举报
回复
bas4.51:
Context ctx = new InitialContext();
Object ref = ctx.lookup("ejbbean");

webshere我没用过,没必要都知道吧,服务器多呢

67,515

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧