tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: How to debug Error: listenerStart?
Date Thu, 02 Apr 2009 13:55:11 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 4/1/2009 6:02 PM, Caldarale, Charles R wrote:
>> From: Dan Armbrust [mailto:daniel.armbrust.list@gmail.com]
>> Subject: Re: How to debug Error: listenerStart?
>>
>> Why doesn't tomcat log a stack trace
> 
> It does, in the log associated with the <Host> of interest:

Yup, although Chuck's example is a missing filter, not a missing
listener. The code is right here, in StandardContext.listenerStart:

>             try {
>                 Class clazz = loader.loadClass(listeners[i]);
>                 results[i] = clazz.newInstance();
>                 // Annotation processing
>                 if (!getIgnoreAnnotations()) {
>                     getAnnotationProcessor().processAnnotations(results[i]);
>                     getAnnotationProcessor().postConstruct(results[i]);
>                 }
>             } catch (Throwable t) {
>                 getLogger().error
>                     (sm.getString("standardContext.applicationListener",
>                                   listeners[i]), t);
>                 ok = false;
>             }

If the class wasn't found, it'll be logged here, and listenerStart
returns false. Given the behavior of listenerStart, it could probably
just propagate the exception instead of starting-up all the listeners,
then failing to load the entire application. That would allow
StandardContext.start() to give you a single error message /including/ a
stack trace.

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

iEYEARECAAYFAknUw74ACgkQ9CaO5/Lv0PA7ywCfYowmHfUIqPm1SGzxosYfm+Es
efoAoIHgujllFs9UXbr77pssHre+iJNU
=743V
-----END PGP SIGNATURE-----

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


Mime
View raw message