DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=35196>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35196 Summary: ServletContextListener contextInitialized called twice during startup Product: Tomcat 5 Version: 5.5.9 Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: Unknown AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] While I was trying to get to the bottom of why my webapp ServletContextListener class was working fine under standalone TOMCAT but getting an error under Eclipse WTP I seem to have uncovered that my contextInitialized() method is actually called twice. This does not seem like correct behaviour. If I startup, use; then shutdown tomcat my webapp handlers are called in this sequence: contextInitialized(); contextInitialized(); contextDestroyed(); The above relates to the bug I'm filing. Below is how I think it relates to another problem I am seeing (and other people seem to be having with integrated tomcat development with Eclipse WTP, check google for "SEVERE: Error listenerStart" and "SEVERE: context [/webapp] startup failed due to previous errors" with "ClassNotFoundException") : I _*SUSPECT*_ the first contextInitialized() call is made from the server/outside-container executation context and therefore has the incorrect class loader in play. I believe this is the reason why my Eclipse WTP tomcat launches fail when any ServletContextListener is in use. For whatever reasons the classpaths and configuration Eclipse specifies seems tighter than the default one when $CATALINA_HOME == $CATALINA_BASE and is uncovering this problem. Eclipse WTP uses $CATALINA_BASE pointed to its mini-deployment directory. I _*SUSPECT*_ the 2nd call I see to run the handler is the proper time to do it, this being from inside the webapp/container executation context and therefore the correct class loader. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]