Discussions

EJB design: Exception: Could not locate EJB with name .....

  1. Exception: Could not locate EJB with name ..... (3 messages)

    Hi all,

    I tried deploying an EJB on weblogic 8.1. The EJB has only one descriptor ejb-jar.xml and no weblogic-ejb-jar.xml. However, an exception message is generated saying "Could not locate the EJB with name xyz in weblogic-ejb-jar.xml"

    What could be possible reasons for this? Help is appreciated.
  2. You have to create a weblogic-ejb-jar.xml, because WL needs it for deploying the EJBs. For example a simple weblogic-ejb-jar.xml contains the following (YourBeanName is the bean name in the ejb-jar.xml):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
      <weblogic-enterprise-bean>
        <ejb-name>YourBeanName</ejb-name> <enable-call-by-reference>True</enable-call-by-reference>
        <jndi-name>ejb/YourBeanName</jndi-name>
      </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

    Ivan
  3. You MUST create the weblogic-ejb-jar.xml descriptor. In fact, the jar won't be correctly deployed if you don't include it...

    Cheers and happy coding,
    Martin
  4. Thanks for your information.[ Go to top ]

    Thanks Ivan and Martin for your replies

    I was thinking ejb-jar.xml is enough to deploy the EJB and weblogic-ejb-jar.xml is only an optional one. Anyway thanks a lot.

    Srikanth