LoginHome home = null;
Context ctx = new InitialContext();
       home = (LoginHome) ctx.lookup("sample.ejb.entity.LoginHome");
      Login login = home.findByName(name);
好了,已经得到实体bean了 :)

解决方案 »

  1.   

    调用EJB的原理都是一样的先得到home接口,然后创建本地或者远程对象,然后就可以调用EJB的业务逻辑方法了
      

  2.   

    Context ctx = new InitialContext();
    Object ref = ctx.lookup("entitybean/entitybean");
    entitybean.loginHome entityLoginHome = (entitybean.loginHome)PortableRemoteObject.narrow(ref, entitybean.loginHome.class);
    entitybean.login userRecord = entityLoginHome.findUser(username);
      

  3.   

    zez兄的实例:
    http://expert.csdn.net/Expert/topic/1627/1627640.xml?temp=.5335199借花献佛:)
      

  4.   

    Properties p = System.getProperties();
    p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
                            "com.ibm.websphere.naming.WsnInitialContextFactory");                                   p.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:900/");
                        InitialContext ctx = new InitialContext(p);
                        m_docCtrlHome      = (DocumentControlHome)PortableRemoteObject.narrow
                         (ctx.lookup("ejb/jp/co/rsk_tokyo/secure/dm/DocumentControlHome"),DocumentControlHome.class);
      

  5.   

    當然這裡應該根據不同的服務器,給他設定不同的環境變量
    比如協議、Factory等