Hi,

Iīm trying to access a bean via JNDI using Tomcat.  Unfortunately, reading
documentation and mailing-lists hasnīt helped me very much.  Could someone
please expalin to me what is involved in accessing a bean in tomcat via
JNDI.  Hereīs what Iīve done so far:

========== WEB.XML ====================
<resource-env-ref>
  <description>
    Object factory for MyBean instances.
  </description>
  <resource-env-ref-name>
    jdo/FindMe
  </resource-env-ref-name>
  <resource-env-ref-type>
    com.test.osforum.services.FindMe
  </resource-env-ref-type>
</resource-env-ref>

======== MY ACTION SERVLET ============
  Context context;
  Context envCtx;
  try {
   context = new InitialContext();
   envCtx = (Context) context.lookup("java:comp/env");

    FindMe findme = (FindMe) envCtx.lookup("jdo/FindMe");
   message = findme.getSillyMessage();
   request.setAttribute("message", message);
  } catch (NamingException e) {
   System.out.println("-----| CATCH NAMING EXCEPTION-: " + e.toString() + "
|----- \n\n");
   e.printStackTrace();
  }
========================================

The above results in a " javax.naming.NamingException: Cannot create
resource instance".  Could someone please point me in the right direction.

Regards,

Michael



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to