-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Emeric,

On 5/26/2010 3:52 PM, Emeric Vernat wrote:
> You could also eliminate the mix & match and add a finally, with the
> following servlet code for example:
> 
> public void init() throws ServletException {
>                boolean initOk = false;
>         mytimer = new Timer("__test__");
>                 try {
>             TimerTask taskPerformer = new TimerTask() { public void
> run() { whatever_function(); } };
>                        mytimer.scheduleAtFixedRate(taskPerformer, 10,
> 10, 864000);
>                         testint = 12;
>             initOk = true; // as last
>         } finally {
>             if (!initOk) {
>                 mytimer.cancel();
>             }
>         }
>          }

Uh.... what? I'm sure that does something, but ... I'm not sure what it
could be.

Could the OP show us the stack trace relative to the warning coming from
Tomcat? I'd bet that Tomcat's "stop leaks" procedure is clearing-out a
static Timer reference and /then/ the ServletContextListener is trying
to access it. That's not supposed to happen, I'm guessing: the "stop
leaks" stuff should run after all ServletContextListeners been notified
that the context is coming down.

I'm sure there is more useful information in the log file that we're not
seeing.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkv9haYACgkQ9CaO5/Lv0PCM1QCgvc2Y/SD1UJntGSBMJzo7ThBx
Ty8An3wul/JusKxqjB3fRZRdikJjdI8l
=z2/W
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to