Hi again,
I've tested with a minor session timeout and printing messages when the
events for binding and unbinding objects in the session. And when
session finishes, there is NO problem with the object, NO null pointer
exceptions.
And one thing more, if the servlet is unloaded, the session it's
supossed to be active until it times out, isn't it?, As I told you in
other message, I print the sessionID, and when the exception occurs, is
the same than before. And the main problem is that in an unrecoverable
error, becouse in following request it remains till the server is
restarted.
:-CCCC
What to do?
Thanks. Bye, Dani.
----- Missatge Original -----
De: "Christopher K. St. John" <[EMAIL PROTECTED]>
Data: Dijous, Agost 23, 2001 6:59 pm
Assumpte: Re: Problems with servlets, tomcat and sessions
> Clemente Dani wrote:
> >
> > But what about executing the init() method when the servlet
> > was already loaded?, why does this happen?
> >
>
> Servlets can be unloaded and then reloaded at any time.
> The lifecycle goes something like:
>
> init() --> service() --> destroy() --> init() --> ...
>
> I'm not talking about the container getting shut down,
> or the code changing and being reloaded, I'm talking
> about normal operation.
>
> Just as an example: a servlet container is free to
> unload your servlet if it hasn't been used for a
> while. Maybe it wants to make room for other servlets
> that are getting used a lot. So it calls destroy() and
> unloads your code. Then, when the next request comes
> in for your servlet, the container reloads it, calls
> init(), and you're back in business.
>
> There (used to be?) some CGI-based hacks that
> actually ran the servlet through it's entire lifecycle
> on every single request. A little extreme, but
> perfectly legal according to the spec.
>
> Assuming that servlets are "always on" is one of
> the reasons people mistakenly assume that they can
> do things like run socket servers in background threads
> from a servlet. Well, you can do it, but what if the
> container decides to swap out your servlet for a couple
> of hours?
>
> I'm not sure if your container is actually doing
> that, but it's something to consider.
>
> Another possibility is that you're using the single
> thread model, which would result in multiple copies
> of your servlet getting started up. (But that wouldn't
> give me an excuse for a quick rant :-)
>
>
> --
> Christopher St. John [EMAIL PROTECTED]
> DistribuTopia http://www.distributopia.com
>
>
========================================================================
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-
> INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
__________________________________________________________________
�Se acercan tiempos salvajes a Navegalia : el planeta de los simios
ya est� aqu�!
La 20th Century Fox, Qtal de Airtel y Navegalia, te tienen preparadas
una serie de sorpresas en este mundo inh�spito. Hay miles de regalos
esper�ndote. P�sate por
http://www.navegalia.com/portal/promos/planetasimios/index.htm y
cons�guelos.
==========================================================================To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets