Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Re: Tomcat stops loading when I run my servlet with
<load-on-startup>

Justin Ruthenbeck

2004-04-23

Replies:


Yes. Rip out the load-on-startup. Now. Don't wait till
Monday. Replace with a context listener (see:
javax.servlet.ServletContextListener). Relax and have a stress-free
weekend.

justin

At 01:55 PM 4/23/2004, you wrote:
>Look at listeners. I think there was a similar thread a while back and the
>solution was to have a listener kick off the servlet after all the other
>processes were done. You could also have your servlet start and then wait
>for a certain amount of time, to allow time for all other processes to
>start.
>
>Doug
>
>
>----- Original Message -----
>From: "Adrian Klingel" <Adrian.Klingel@(protected)>
>To: <tomcat-user@(protected)>
>Sent: Friday, April 23, 2004 4:03 PM
>Subject: Tomcat stops loading when I run my servlet with <load-on-startup>
>
>
> > I have a servlet which calls a method on itself to poll a directory for
>XML
> > files. When one is found, another method ("read()" is called which
> then
> > creates a SAX parser and attempts to validate the file against an XML
> > schema. Upon calling the "parse()" method, Tomcat freezes. It doesn't
> > create or write to a log, and nothing else starts up. Nothing is
>accessible
> > on port 8080, because Tomcat doesn't make it to the point where it
> mounts
> > that port.
> >
> > When I remove the <load-on-startup> from this particular app's web.xml,
> > Tomcat completes its startup process and things are accessible. I can
>then
> > reintroduce the <load-on-startup> to the web.xml and Tomcat will
> > automatically kick off the servlet. This time nothing freezes, and the
> > program runs as it is supposed to.
> >
> > My program is attempting to validate this XML file against a schema
> which
>is
> > accessible locally on port 8080. But that port is prevented from
> becoming
> > available, so the program will just wait forever.
> >
> > My question is, how can I prevent my servlet from starting up until
> after
> > Tomcat has completed its startup procedure? I've specified higher
> numbers
> > in the <load-on-startup> element, but to no avail.
> >
> > Thanks for any help you can offer.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> > For additional commands, e-mail: tomcat-user-help@(protected)
> >
> >
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(protected)


______________________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
______________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.