You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/05/23 07:12:07 UTC
DO NOT REPLY [Bug 20173] New: -
Cannot lookup JNDI resources in init method of Filters or autostarted servlets
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20173>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20173
Cannot lookup JNDI resources in init method of Filters or autostarted servlets
Summary: Cannot lookup JNDI resources in init method of Filters
or autostarted servlets
Product: Tomcat 4
Version: 4.1.24
Platform: All
OS/Version: All
Status: NEW
Severity: Blocker
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: rgc197@zepler.org
JNDI lookups throw NamingException "Cannot create resource instance
" from the init method of a Filter or automatically started Servlet.
I did some probing around and found out the following:
Say we are using a simple bean of class "Foo" and we bind it to the name "foo".
1. NamingContext.bind(foo, Reference Class Name: Foo, false) is called.
2. The init method is called but fails, see above.
3. NamingContext.bind(foo, ResourcRef
[className=Foo,factoryClassLocation=null,factoryClassName=org.apache.factory.Res
ourceFactory,{type=scope,content=Shareable},
{type=factory,content=org.apache.naming.factory.BeanFactory}], false) is called.
What seem to be happening here is that Filters and Servlets are started before
the web-app naming context has been properly configured! It would appear to be
an oversight in the container setup procedure.
Cheers,
Richard.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org