cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: ClassNotFound versus ExceptionInitializationError
Date Tue, 16 Nov 2010 20:52:51 GMT
On Tuesday 16 November 2010 3:17:25 pm Benson Margulies wrote:
>  This code in Aegis can get an ExceptionInInitializerError (rather
> than a ClassNotFound). Think it might be more better to eat those,
> too?

Honestly, in that case, I would just catch "Throwable" as there could be a 
slew of potential things there such as Security exceptions, ClassDefinition 
type errors, etc...   Since it's an "ignored" exception anyway, I'm not sure I 
would worry about all the permutations.

Dan



> 
> private static Class<? extends Annotation> load(String name) {
>         try {
>             return
> AnnotationReader.class.getClassLoader().loadClass(name).asSubclass(Annotati
> on.class); } catch (ClassNotFoundException e) {
>             return null;
>         }
>     }

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message