I implemented a servlet with multi-threading. When there are too many errors of the servlet, i would like to unload the servlet form the tomcat container and this should not disturb other apps running on tomcat.
Tried the destroy() method of the servlet, but did'nt work
My Config --------- jdk1.4, tomcat 5.5
Please let me know on this.
Thank you in advance, Regards, Kam
posted 10 years ago
The destroy() method of a servlet does not actually destroy anything. It is a method that is called by the container when the servlet instance is about to be destroyed, and it is there for the developer to insert code to run logic that should run before the instance is destroyed, such as cleaning up resources.
In regards to your question, why are you using a multi threaded servlet? I am not saying this is wrong, but it seems to me that this drastically overcomplicates the application. I would suggest pushing the threading into a helper class and using the servlet as more of a controller.
If you could post more about what your application does, and what kind of errors you are catching, I couldbe of more help to you.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook