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 22390] - init() method called twice
Date Thu, 02 Oct 2003 02:58:43 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=22390>.
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=22390

init() method called twice





------- Additional Comments From techd2001@attbi.com  2003-10-02 02:58 -------
I have had a similar problem which turned out to be a configuration issue.  Like
you, my init() method was called twice - and similar to your static variable, I
had static code being executed in a synchronized block that seemed to be
allowing multiple threads in.  

On investigation, it turns out the issue was the WARP connector from Apache to
Tomcat... Apache used one alias for the server, tomcat used another which caused
the same code to be loaded as if from two different HOSTs... each one starting
an instance of the servlet, and each one using a different class loader and
initializing the servlet code and static variables (check to see that there is
only one directory created under <catalina_home>/work/ ).  

I'm guessing that rather than starting the same servlet twice, the symptom you
are observing is from two completely different instances of your servlet each
being started once.  There might be different ways to recreate this, but make
sure your server names in your apache config match the <HOST> name in your
Tomcat server.xml if you are using a WARP connector.

---------------------------------------------------------------------
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