On Mon, 22 Oct 2001, Jovie Castaneda wrote: > Im trying to load this servlet but I think im doing some funny thing here > I edited the following tags in the web.xml > <servlet-name> > Demolog > </servlet-name> > <servlet-class> > Demolog > </servlet-class> > <load-on-startup> > -2147483646 ---> i am not sure of this so i retained this value > </load-on-startup> > ...then I tried to start Tomcat and it says that it "cannot load Demolog" > How do I get around with this?
FIrstly, the load-on-startup is explained in the spec (worth a read: http://java.sun.com/products/servlet/download.html), but you have two options. the simple option is to use an empty <load-on-startup /> tag, and tomcat will load the server (call its init method) in the startup procedure, with no guarentee of order. If you need servlets to be loaded in a certain order, then you specify the value <load-on-startup>1</load-on-startup> in the load on startup tag. lower values are loaded first. now if you get the error message, that means something is going wrong in yourt init method. use your favourite logging package to find out whats going on (see http://jakarta.apache.org/log4j if you dont have a favourite logging package (o: ). hth dim > Thanks in advance. > > -----Original Message----- > From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 22, 2001 10:07 AM > To: [EMAIL PROTECTED] > Subject: Re: servlet in startup > > > Look at the load on startup flag in web.xml > > hth > dim > > On Mon, 22 Oct 2001, Jovie Castaneda wrote: > > > Hi guys, > > > > Can someone please help me how to make my servlet run when the Tomcat > > starts up. What do I have to do in my codes > > to impelement this or some setup needed for my Tomcat config.? > > Thanks in advance > > > > > > > >
