tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Colebatch <...@bigpond.net.au>
Subject Re: Tomcat 4.0.1 doing odd Exception handling
Date Wed, 31 Oct 2001 00:06:17 GMT
If an Error is thrown, the catch (Exception) wont catch it.  If all you
want to do is find out what is going on, then you could change the catch
(Exception) to catch (Throwable) and you should see something.  *warning*
this is about the only thing worse than catch (Exception) imho, so dont
leave it in your code once your figured it out (o:

cheers
dim

On Tue, 30 Oct 2001, Rob Johnson wrote:

> I'm having an interesting problem with Tomcat 4.0.1:
> 
> I run this line of code from within a servlet:
> 
> try {
>     System.out.println("1");
>     Classloader.getSystemClassLoader().loadClass(classname);
>     System.out.println("2");
> } catch (Exception e) {
>     System.out.println("Executing catch block");
> } finally {
>     System.out.println("Executing finally block");
> }
> 
> The Classloader line of code causes some sort of error because '2' is never
> printed out, but the catch block isn't executed either - execution jumps
> straight to the
> finally block. I can't find anything unusual in the logs.  Can anyone help?
> 
> The test code works fine with Tomcat 3.
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message