如果是单独发布,最好用ejb-local-ref描述一下

解决方案 »

  1.   

    NameNotFoundException from test client
     错误代码描述:
      javax.naming.NameNotFoundException: Unable to resolve
     问题发生时机:
      部署完EJB JAR文件后,运行的时候
     产生原因:
      不能找到EJB的JNDI名。
     解决方法:
    打开Weblogic Server console检查部署是否有错,在Deployments——>EJB里找到EJB的模块名。检查名称后,点击右边窗口的Deploy,如果JAR部署正确的话,你将在右边的窗口的Deployment状态是true
      

  2.   

    Deployment Status by Target:Target Target Type Deployed   
    myserver Server true  
    JAR部署正确的话,你将在右边的窗口的Deployment状态是true
    JDNI描述如下:
    <weblogic-enterprise-bean>
            <ejb-name>Dept</ejb-name>
                  ...........
            <local-jndi-name>Dept</local-jndi-name>
        </weblogic-enterprise-bean>我想问题也应该是在JNDI上,但不知从何下手找问题,知道的就只有部署文件里的描述了, 
     
     
      

  3.   

    以下是我写过一个,参考一下:
    ejb-jar.xml:
    <entity>
          <ejb-name>Module/Account</ejb-name>
          <local-home>com.xxx.module.AccountLocalHome</local-home>
          <local>com.xxx.module.AccountLocal</local>
          <ejb-class>com.xxx.module.AccountBean</ejb-class>
          <persistence-type>Container</persistence-type>
          <prim-key-class>com.xxx.module.AccountPK</prim-key-class>
          <reentrant>False</reentrant>
          <resource-ref>
            <res-ref-name>jdbc/ModuleOracle</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
          </resource-ref>
        </entity>    <session>
          <ejb-name>Module/Manager</ejb-name>
          <home>com.xxx.module.ManagerHome</home>
          <remote>com.xxx.module.Manager</remote>
          <ejb-class>com.xxx.module.ManagerBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>      <ejb-local-ref>
            <ejb-ref-name>ejb/Module/AccountLocal</ejb-ref-name>
            <ejb-ref-type>Entity</ejb-ref-type>
            <local-home>com.xxx.module.AccountLocalHome</local-home>
            <local>com.xxx.module.AccountLocal</local>
            <ejb-link>Module/Account</ejb-link>
          </ejb-local-ref>
        </session>
    weblogic-ejb-jar.xml:
    <?xml version = '1.0' encoding = 'GBK'?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
         <weblogic-enterprise-bean>
            <ejb-name>Module/Manager</ejb-name>
            <reference-descriptor>
                <ejb-local-reference-description>
                    <ejb-ref-name>ejb/Module/AccountLocal</ejb-ref-name>
                    <jndi-name>Module/AccountLocal</jndi-name>
                </ejb-local-reference-description>
            </reference-descriptor>
            <jndi-name>Module/Manager</jndi-name>
        </weblogic-enterprise-bean>    <weblogic-enterprise-bean>
            <ejb-name>Module/Account</ejb-name>
            <entity-descriptor>
                <entity-cache>
                    <concurrency-strategy>Exclusive</concurrency-strategy>
                </entity-cache>
                <lifecycle>
                    <passivation-strategy>default</passivation-strategy>
                </lifecycle>
                <entity-clustering>
                    <home-is-clusterable>true</home-is-clusterable>
                </entity-clustering>
            </entity-descriptor>
            <reference-descriptor>
                <resource-description>
                    <res-ref-name>jdbc/ModuleOracle</res-ref-name>
                    <jndi-name>jdbc/ModuleOracle</jndi-name>
                </resource-description>
            </reference-descriptor>
            <jndi-name>Module/Account</jndi-name>
            <local-jndi-name>Module/AccountLocal</local-jndi-name>
        </weblogic-enterprise-bean>
    </weblogic-ejb-jar>