You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/12/11 19:48:18 UTC

DO NOT REPLY [Bug 25452] New: - JSP compile failure does not stop Ant build

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25452>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25452

JSP compile failure does not stop Ant build

           Summary: JSP compile failure does not stop Ant build
           Product: Tomcat 5
           Version: 5.0.16
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: larry@oculan.com


When using Tomcat 5.0.16's org.apache.jasper.JspC class as a taskdef Ant tag, if
there is a failure in compiling a JSP file into a Java file, Ant does not know
about it.  Ant will continue the rest of the build regardless of any JSP compile
failures.  It might even report success depending on the rest of the build.

I would think that a failed JSP compile should halt the build similar to a
failed Java compile.  (Or at least have a failOnError option.)  What I see
instead is that any JSPs that fail to compile will cause JspC to write an error
message to the logging API and write out a zero-length Java file.  Ant, however,
just continues building after the JspC task is done.

I've seen JSPs not compile for the following reasons: bug #25488, a taglib or
JSP action tag is unbalanced, or because an include directive tries to include a
file that does not exist.  There are probably many other reasons a JSP would
fail to be parsed.

Workarounds include having a human check the log output of the JspC tag for
error messages or do a "find . -empty" to find zero-length Java files.

To solve this issue I recommend having JspC.execute() throw an
org.apache.tools.ant.BuildException on build errors.  This will work for both
the Ant build and when running from the commandline.  When running from the
command line the main() method can catch and handle the exception appropriately.

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