You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/05/31 14:55:40 UTC

[PATCH] Catch some more exceptions when JAXP is not present

>>>>> "EM" == Erik Meade <em...@geekfarm.org> writes:

 EM> I was cleaning up my classpath ( i.e. setting it over :)), and
 EM> noticed that if you don't have the SAX parser.jar in your class
 EM> path you get NullPointerException instead of a
 EM> NoClassDefFoundError.

This seems to depend on the JDK, on Linux (Blackdown's 1.2.2RC4) I get
the NoClassDefFoundError in either case - but this one remains
uncaught.

The appended patch catches the NoClassDefFoundError as well as
NullPointerException and emits a more meaningful error message. BTW
the NoClassDefFoundError results from the ClassLoader loading
ProjectHelper not from the Class.forName in the try block.

I had to patch BuildException to accept Errors as well as Exceptions
as cause.

Stefan


Re: [PATCH] Catch some more exceptions when JAXP is not present

Posted by Erik Meade <em...@geekfarm.org>.
Stefan,

Your patch does the trick.

Erik Meade

At 02:55 PM 5/31/2000 +0200, you wrote:
> >>>>> "EM" == Erik Meade <em...@geekfarm.org> writes:
>
>  EM> I was cleaning up my classpath ( i.e. setting it over :)), and
>  EM> noticed that if you don't have the SAX parser.jar in your class
>  EM> path you get NullPointerException instead of a
>  EM> NoClassDefFoundError.
>
>This seems to depend on the JDK, on Linux (Blackdown's 1.2.2RC4) I get
>the NoClassDefFoundError in either case - but this one remains
>uncaught.
>
>The appended patch catches the NoClassDefFoundError as well as
>NullPointerException and emits a more meaningful error message. BTW
>the NoClassDefFoundError results from the ClassLoader loading
>ProjectHelper not from the Class.forName in the try block.
>
>I had to patch BuildException to accept Errors as well as Exceptions
>as cause.
>
>Stefan
>