0 Replies Latest reply on Aug 5, 2003 9:58 AM by Robert Costanzo

    EJB lookup from servlet in jboss-3.2.1_tomcat-4.1.24 distrib

    Robert Costanzo Newbie

      I am trying to lookup an EJB from a servlet in Tomcat using the name java:comp/env/ejb/EJBName.

      However, the issue is I get a NamingException for "comp not bound". I checked the JNDIView MBean and my EJBs do bound properly within the comp space.

      I added the necessary ejb-local-ref to my web.xml and my EAR works fine with Jetty. It's only when I'm using Tomcat that I get this issue.

      What is the main difference between the Jetty bundle and the Tomcat bundle for the JBoss 3.2.1 release that these differences would exist? Don't they both run as embedded servlet containers?

      The code that does the actual lookup looks like:
      InitialContext initialContext = new InitialContext();
      localHome = (mts.psp.ui.SiteManagerLocalHome) initialContext.lookup("java:comp/env/ejb/SiteManagerLocal");

      My web.xml (which works fine for Jetty) has the following ejb-local-ref:
      <ejb-local-ref>
      &nbsp&nbsp <ejb-ref-name>ejb/SiteManagerLocal</ejb-ref-name>
      &nbsp&nbsp <ejb-ref-type>Session</ejb-ref-type>
      &nbsp&nbsp <local-home>mts.psp.ui.SiteManagerLocalHome</local-home>
      &nbsp&nbsp mts.psp.ui.SiteManagerLocal
      &nbsp&nbsp <ejb-link>SiteManager</ejb-link>
      </ejb-local-ref>

      Is there some difference between Jetty and Tomcat which I'm totally missing? Any help would be greatly appreciated.