Local Entity Bean lookup failed in oc4j

Discussions

EJB design: Local Entity Bean lookup failed in oc4j

  1. Local Entity Bean lookup failed in oc4j (4 messages)

    I am using JDeveloper 9.0.5.2 (Build 1618) for EJB development. I have created an CMP bean called "Sequence" with only local interfaces. and Stateful session bean with remote interfaces called "TestSession". In TestSession, I have added Survey as EJB Local Reference (ejb/local/Survey). The code of the TestSessioBean is as follows:

    public class TestSessionBean implements SessionBean {
      private SessionContext context;
      private SurveyLocalHome surveyLocalHome;

      public void ejbCreate() {
      }

      public void ejbActivate() {
      }

      public void ejbPassivate() {
      }

      public void ejbRemove() {
      }

      public void setSessionContext(SessionContext ctx) {
        this.context = ctx;
        try {
          surveyLocalHome = getSurveyLocalHome();
        } catch (NamingException ne) {
          ne.printStackTrace();
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      private SurveyLocalHome getSurveyLocalHome() throws NamingException {
        final InitialContext context = new InitialContext();
        return (SurveyLocalHome)context.lookup("java:comp/env/ejb/local/Survey");
      }
    }

    In the Embedded OC4J Server Preferences I selected "Look up for all EJB during OC4J Startup".

    When I run my application, I got the following error.
    --------------------------------------------
    Checking that EJBs were successfully deployed in embedded OC4J...

    **** Warning: The EJB Survey was not found via an InitialContext lookup. Error encountered: Survey not found.

    **** Warning: Not all EJBs were successfully deployed. The EJB application may fail during testing.
    **** Please use the EJB Verifier to check your EJB modules for errors by right-clicking on ejb-jar.xml and choosing 'Verify Enterprise Beans'.
    ------------------------------------------------
    After I saw this error message, I did verify enterprise beans and got the following output

    Verifying enterprise beans in deployment descriptor D:\My Documents\jdev\testingPurpose\Project\src\META-INF\ejb-jar.xml.
    Verifying enterprise bean TestSession.
    Verifying EJB home interface D:\My Documents\jdev\testingPurpose\Project\src\Project\TestSessionHome.java.
    Verifying EJB interface D:\My Documents\jdev\testingPurpose\Project\src\Project\TestSession.java.
    Verifying EJB D:\My Documents\jdev\testingPurpose\Project\src\Project\TestSessionBean.java {1}.
    Verifying enterprise bean Survey.
    Verifying EJB Local home interface D:\My Documents\jdev\testingPurpose\Project\src\Project\SurveyLocalHome.java.
    Verifying EJB Local interface D:\My Documents\jdev\testingPurpose\Project\src\Project\SurveyLocal.java.
    Verifying EJB D:\My Documents\jdev\testingPurpose\Project\src\Project\SurveyBean.java {1}.
    Verifier completed. 0 Errors, 0 Warnings.

    Verification shows no errors. But deployment is not successful. Any kind of configuration needs to be updated to lookup for EJBs successfully?
  2. Local Entity Bean lookup failed in oc4j[ Go to top ]

    Sorry, typo error, Entity bean name is Survey, not Sequence.
  3. Local Entity Bean lookup failed in oc4j[ Go to top ]

    Hi, try:

    ejb/Survey

    instead of:

    ejb/local/Survey
  4. Local Entity Bean lookup failed in oc4j[ Go to top ]

    Hi Raju,
    I have smae problem with JBoss, Please let me know if you have found the solution.
    Thanks
    Gautham
  5. Hi Gautham,
    I have smae problem with JBoss, Please let me know if you have found the solution.
    Thanks
    Joel