3 Replies Latest reply on Mar 25, 2002 1:05 PM by Adrian Brock

    servlet looking up EJB...NameNotBound

    Chris Cuilla Newbie

      JBoss 2.4.4
      Tomcat 4.0.1

      Running with Catalina integrated.

      Here's what I have...

      code:

      Context
      envContext = (Context)initialContext.lookup("java:comp/env");
      MyEJBHome
      myEJBHome = (MyEJBHome)envContext.lookup("internal/MyEJB");


      ejb-jar.xml:


      <ejb-name>MyEJB</ejb-name>
      ...etc...



      jboss.xml:


      <ejb-name>MyEJB</ejb-name>
      <jndi-name>internal/MyEJB</jndi-name>



      web.xml:

      <ejb-ref>
      <ejb-ref-name>internal/MyEJB</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.att.broadband.eai.MyEJBHome
      com.att.broadband.eai.MyEJB
      <ejb-link>MyEJB</ejb-link>
      </ejb-ref>


      problem:

      javax.naming.NameNotFoundException: MyEJB not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:421)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)


      This works under ATG Dynamo (which comparatively speaking is rather surprising!) :-(

      When I do this:

      MyEJBHome
      myEJBHome = (MyEJBHome)initialContext.lookup("internal/MyEJB");

      It works.

      Seriously though, is there something I am missing here?

      Chris