tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Weiss <swe...@aamc.org>
Subject Re: Getting tomcat to instantiate an instance of a servlet after failed initialization attemp
Date Mon, 02 Oct 2000 22:16:11 GMT
> Renee Petris wrote:
> 
> I have a servlet that attempts to connect to a remote service during
> the init method. If the remote service is unavailable, the servlet
> throws a ServletException. If I then fix the problem, i.e. make the
> service available, and retry the servlet, Tomcat doesn't try to
> re-instantiate the servlet. I've checked this by putting a println
> statement in the init method. I have to restart Tomcat to get the
> servlet to start. According to the servlet spec, the servlet container
> may instantiate a new instance at any time after a failed
> initialization attempt unless the servlet threw an
> UnavailableException. Is there a way to make tomcat attempt to
> re-instantiate the servlet?
> 

I don't know if what you're asking is possible, but you could accomplish
what you want by starting up a background thread in your servlet's
init() method which just keeps trying to connect to the remote object.

-Steve
-- 
Steve Weiss      Association of American Medical Colleges
(202)828-0428    mailto:sweiss@aamc.org    http://www.aamc.org

Mime
View raw message