1 Reply Latest reply on Mar 6, 2002 8:55 PM by gokul janga


    george porter Newbie

      I'm running Tomcat separately from JBoss and am trying to access the Interest example Session Bean from a servlet client. Accessing it from the InterestClient example works fine, but I get the following error in the stack trace from a servlet exception:
      "javax.naming.NamingException: Cannot create resource instance"

      From the debug code I can verify that a JNDI context object is successfully generated. But the lookup method fails to generate a reference to the Interest bean, as listed:
      Object ref = jndiContext.lookup("java:comp/env/ejb/Interest");

      I have declared in the Tomcat deployment descriptor for my webapp the corresponding EJB references, as follows in web.xml:
      EJB reference to Interest Session Bean

      I would greatly appreciate any suggestions on solving this one.


      P.S. Sorry if this problem has already been covered somewhere!

        • 1. Re: NamingException
          gokul janga Newbie

          Hi george,

          I've been trying out this combo of Tomcat 4.0
          (running separately) with JBoss as well
          and have found a couple of a things to check
          to ensure no JNDI related problems when
          accessing EJBs from servlets -

          a) the servlet webapp has the
          and jboss-client.jar in the WEB-INF/lib directory

          b) Tomcat is started with the -nonaming option.
          You can edit the startup.bat/startup.sh
          in the bin directory of the installation
          call "%EXECUTABLE%" start -nonaming %CMD_LINE_ARGS%

          let me know if this works for you.