You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Henrik Vendelbo <hv...@bluprints.com> on 2003/09/14 19:30:17 UTC

Servlet.destroy but not init called when context is reloaded

BusinessBluprints letterI have to admit that I am quite baffled. Hopefully
someone can point me in the right direction, so I can find out what is going
wrong.

My overall setup is a Servlet front calling a WebService backend. The whole
thing runs on the same Tomcat server under Win2k. I have combined Tomcat and
Axis according to descriptions, and have been using it for a while without
any problems. So it probably isnt in the Axis department I should look.

If I restart the Tomcat service and make one request to the servlet it
correctly calls the webservice, receives a reply, and formats it into a nice
HTML reply. I can go on making that exact same HTTP request and I will get
the same HTML result, with no apparent failures in the logs.

Now, if I make a slightly different servlet request (that would normally
succeed) the context is reloaded calling destroy() but not init() on the
servlet, which subsequently fails because I rely on init being called before
doGet(..).

To make matters even more confusing, it makes no difference if I reload the
Tomcat service. On the next request the context will be reloaded and call
destroy() but no init().

Looking at the log this weird behaviour seems to start after init() threw an
exception. I did restart the Tomcat service, but the somehow the server kept
malfunctioning from this point onwards. Can the init() somehow be disabled,
so it wont be called on future reloads ?

Is this 1) an issue with garbage collection order 2) some JRE problem, that
persists across Tomcat reloads 3) Potentially a Tomcat bug 4) Me being
stupid ?

looking at the log, there might be a 5th possibility relating to Axis being
being busy starting, resulting in a socket timeout that leaves the
communication in an unstable state, does that sound plausible ?

Rather than waste your time by pasting a 1000 lines from the logfile. My
question is simply : what is the most likely cause of my problem ?

Environment :
Tomcat 4.1.27
Axis 1.1
J2SDK 1.4.2


Thanks for your time,

Henrik Vendelbo