没有列子
但我觉的这怎么会找不到那????
都在一个容器里的话 那你把其他的session bean 定义成本地接口,这样效率高些
然后把你的业务逻辑分派器定义成远程接口就可以了
自己随便写 大概思路就应该是这样的,希望对你有帮助
javax.naming.Context context;
dzsb.ejb.session.DjYhsz1Home djYhsz1Home=null;
dzsb.ejb.session.DjYhsz2Home djYhsz2Home=null;
dzsb.ejb.session.DjYhsz3Home djYhsz3Home=null;
private javax.naming.Context getinitContext()
{
try{
if (context==null) context = new javax.naming.InitialContext();
return context;
}
catch (Exception e)
{
throw new EJBException(e);
}
}
private void init(int i)
{
context= this.getinitContext();
try{
switch (i){
case 1:
if (this.djYhsz1Home==null)
this.djYhsz1Home = (dzsb.ejb.entity.DjYhsz1Home) context.lookup("DjYhsz1");
break;
case 2:
if (this.djYhsz2Home==null)
this.djYhsz2Home = (dzsb.ejb.entity.DjYhsz2Home) context.lookup("DjYhsz2");
break;
case 3:
if (this.djYhsz3Home==null)
this.djYhsz3Home = (dzsb.ejb.entity.DjYhsz3Home) context.lookup("DjYhsz3");
break;
}
}
catch (Exception e)
{
}
}