W3C home > Mailing lists > Public > www-jigsaw@w3.org > March to April 1999

Re: more bug with servlet init()?

From: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
Date: Wed, 28 Apr 1999 18:09:04 +0200
Message-ID: <372732A0.E160FB15@sophia.inria.fr>
To: "Bi, Xiaolian" <Xiaolian_Bi@tri.sbc.com>
CC: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
"Bi, Xiaolian" wrote:

> 4/13's maintenance release fixed the bug of servlet being loaded every time
> and thus init() being called every time when servlet is auto loaded and
> accessed as com.xxx.xxx.servlet
> I have been using the maintenance release since then, and it largely fixed
> the problem. However, from time to time I noticed that the init() would be
> called again without servlet.class file change (ie there is no need to
> reload the servlet). The difference from the original bug is that clearly
> the serlvet is not reloaded ( I can tell that because I don't see a printout
> stating the servlet is loaded), but only init() is called. My initial guess
> was that maybe the serlvet was unloaded as a result of being idle for long
> time. But then I noticed it could happen not long after the serlvet is
> loaded first time. Also my theory does not make sense because it appears
> only init() is called, but servlet is not re-loaded ( the servlet would have
> to be reloaded in the case that servlet is timed out and unloaded)
> Are their conditions that would cause a servlet's init() to get called? Or
> is there a subtle bug?

The servlet class is not reloaded after the timeout, the destroy method is
then if another request occurs, the server create a new instance of the servlet
and call the init method. Please check the timeout value in ServletProperties
in the ServletWrapper.

The init method is called:
1) the first time the servlet is loaded
2) the servlet class has changed
3) after the timeout
4) some attritutes of ServletWrapper have been modified
5) there is a bug ;-)

Regards, Benoit.

- Benoît Mahé -------------------------------------------------------
                      World Wide Web Consortium   (W3C)
                    Architecture domain - Jigsaw Engineer

                http://www.w3.org/People/Mahe  - bmahe@w3.org
Received on Wednesday, 28 April 1999 12:09:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:34 UTC