在  ejb-jar.xml
 <ejb-ref>
                <description>This is description</description>
                <ejb-ref-name>ejb/MyBean</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <home>TIBDataServerEjb.TIBDataServerHome</home>
                <remote>TIBDataServerEjb.TIBDataServer</remote>
                <ejb-link>TIBDataServer</ejb-link>
            </ejb-ref>
指定ref 然后调用就可以了。

解决方案 »

  1.   

    在ejb-jar.xml
               <ejb-ref>
                    <description>This is description</description>
                    <ejb-ref-name>ejb/MyBean</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <home>TIBDataServerEjb.TIBDataServerHome</home>
                    <remote>TIBDataServerEjb.TIBDataServer</remote>
                    <ejb-link>TIBDataServer</ejb-link>
                </ejb-ref>
      

  2.   

    假设你要调用的EJB Home名称为AccoutHome;
    EJB REMOTE 接口为Account;
    EJB bean 为AccountBean;
    如下为示例程序段,可加入你调用其他EJB的EJB的函数中任何位置:
    import java.Naming.*;
    import javax.rmi.*;
    InitialContext ic=new InitialContext();
    Object objRef;
    AccountHome accountHome;
    Account accout;
    objRef=ic.lookup("...");//其中为要调用的EJB的JNDI NAME
    accountHome=(accountHome)PortableRemoteObject(objRef,AccountHome.class);
    account=accountHome.create(...);//此时可以调用你的create方法;
    account.otherfunction();//其他方法。略
      

  3.   

    我在jb6+bes4.5+oracle环境下,使用rainight的方法为什么不行?