tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20173] New: - Cannot lookup JNDI resources in init method of Filters or autostarted servlets
Date Fri, 23 May 2003 05:12:07 GMT
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


Mime
View raw message