give up, restart tomcat.

i found that to be the only sureproof way :-(

-----Original Message-----
From: Endre Stølsvik [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 27, 2000 4:49 PM
To: [EMAIL PROTECTED]
Subject: reloading..


I'm going a bit crazy soon, so any help here would be much appreciated!

I have a DB pool. I instantiate this class as a "connection holder", and
the pool is a static field in this class. I also have a static int that I
increase each time I make a new of these connection holders, and decrease
each time they get garbage collected.
  I Initialize this from a servlet (Startup.java) that I've defined as
"load-on-startup". This goes just fine, and everything is merry.

When I recompile my servlets, beans and helpers (rm all .class files, and
jikes the whole thing), I apparently have "lost" this pool somewhere. I
get a nullpointer exception at the point where I try to reference it. The
counter I was talking about has also been reset to zero.

I then tried to put a call to the initialization in the "doGet()" of the
Startup.java, so that I can call it when I need it. This is when things
get annyoing.
  I now (sometimes!) apparently get two different "contexts" of servlets.
This because the call to Startup.java and this other servlet gives me
_different_ values from this counter. So the Startup.java is happy,
because the pool is working fine there, but my main servlet hasn't got the
same class or whatever.

As I've understood it, this is because I now have two different
classloaders loading these classes, and in reality, two enirely different
contexts. Is this really the way it's meant to be, or am I totally doing
something wrong?

Is there _anything_ I can do from within the servlets to just get rid of
ALL classes and start all over if tomcat notices a "reload-situation"? If
I have to go to the tomcat source, where should I start?!

Any help would much appreciated.

--
Mvh,
Endre


Reply via email to