On Wed, May 22, 2002 at 12:31:37PM +0100, Mike Whittaker wrote:
> In a servlet that <loads on start up>
> The init method trys to create a new Automate();
> But it does not. The init method terminates at that point and when the
> servlet is eventually called by URL
> the init method runs again and again terminates at the same point.
> The only time any exceptions are thrown is the second time round (because
> stuff at the end of the init that is never executed is vital).
> Heres the class it doesn't like. None of the Sys.out's are executed.
>
>
> public class Automate {
>
> static Timer timer;
^^^^^^^
I don't remeber the exact details, but some of the guys here did
something similar recently. They ran into problems because of the
way threads and init interact and in the end they had to start a
new thread in and do a sleep rather than use timer. I'm not sure
that's the problem you have here, but you might give it a shot.
> static Weather forecast;
> static int count;
> static String[] month = {"","","","","","","","","","","",""};
>
> Automate() {
> System.out.println("1");
> timer = new Timer();
> System.out.println("2");
> count=0;
> System.out.println("3");
> if(!UKRoutes.weatherOn) {forecast = new Weather(true);}
> System.out.println("4");
> timer.schedule(new AutoMaintain(), 0);
> System.out.println("5");
> timer.schedule(new AutoWeather(), 0);
> System.out.println("6");
> }
>
>
> --
> TIA
> Mike W.
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
--
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html