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 35196] New: - ServletContextListener contextInitialized called twice during startup
Date Fri, 03 Jun 2005 02:59:23 GMT
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: darryl@darrylmiles.org


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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message