tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McClure, James" <>
Subject DefaultContext content not available in Servlet init()
Date Mon, 19 Jul 2004 21:19:56 GMT
Hello users,

My environment: Tomcat 4.1.24, JDK 1.4.1_02, XP.

I'm attempting to move some existing jdbc initialization into my servlet's
init() method which uses JNDI lookup.  This is failing and yielding an
exception with the message: "Name jdbc is not bound in this Context".  The
exception is being thrown during the call to the context lookup() method.
Prior to these modifications, the same logic exists in the doGet() portion
of the servlet and works just fine.  My current server.xml configuration
contains a DefaultContext section which contains all of my various jdbc
resources since these are common to all of web-apps.

By trial and error, I have found that if I make a copy of the DefaultContext
content and place it as a part of *each* web-app context, then the relocated
logic works in init().  However, maintaining multiple entries for each jdbc
source I have is not acceptable.

I've seen complaints about DefaultContext not working properly, but cannot
find anyone who has a workaround for this specific issue.

Has anyone seen and addressed this issue successfully?

James McClure

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message