Hi Serge, > -----Original Message----- > From: Serge A. Redchuk [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 08, 2002 10:30 AM > To: [EMAIL PROTECTED] > Subject: Re[2]: Init method of servlet called twice? > > > AB> This topic was discussed about a week ago, and Craig gave > perfect and clear > AB> answer (as always). Try mail archives. > AB> As far as I remember init() can be called multiple times if: > AB> 1. TC4 and servlet implements SingleThreadModel > AB> 2. servlet is called by invoker (something like > http://myhost/servlets/myServlet) > AB> 3. init() throws exception (that I don't remember exactly) > > Oh, yes. Craig answered to me as denoted above, but I still didn't solved > this problem. Partially I did not returned to my problem yet, but I > think that no any of 3 described reasons match my case. > > 2: I've checked many times before I've asked that question. My init > servlet is called _once_. There's only one reference to the init > servlet class in _one_ of my web.xml files. > > 3: init doesn't throws exceptions : log files is clear. Also there's > a thread that starts from init(), and the thread remains alive (I > think in case of exception this child thread must die). > > 1: My init servlet is extended from the Struts init servlet, > so it doesn't implements SingleThreadModel, as Craig said. > > Moreover, I said, I declared a static variable in my init servlet > class, and affected this variable, and traced this variable state into > log file. > And I certainly know: I have several instances of this variable !!! > Each thread of init servlet has own static variable !!! >
Good idea, and it shows the problem. Your class gets loaded in different class loaders. So, it looks like your servlet still defined in more then one place. > Again: > OS: RHL > JDK: sun, 1.3 > > I'll show my configs and code if anybody will be so greatful to deep > into. > Anton -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
