You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by M Coffee <mr...@yahoo.com> on 2006/07/06 20:19:13 UTC

JSP Compiler error messages lower quality in Tomcat 5.5?

The quality of the JSP compiler error messages for Tomcat 5 seems much worse than those for Tomcat
4.  The difference makes debugging much harder under the Tomcat 5.5 releases.  Is there a way to
build Tomcat with different components to have it provide better compiler error messages?

As an example, this JSP code snippet:

errMsg = "Uploaded file has no readable records or is empty.");

generates this compiler error message in Tomcat 5.5.12:
--------------------------------------------------------
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 7 in the jsp file: /adminArea/UploadFile.jsp
Generated servlet error:
Syntax error on token ")", delete this token
------------------------------------------------------------

However, the same file under Tomcat 4.1.24 generates this compiler error message:
-----------------------------------------------------------
Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac]
D:\jakarta-tomcat-4.1.24\work\Standalone\localhost\_\adminArea\UploadFile_jsp.java:1998: ';'
expected
    [javac] 				errMsg = "Uploaded file has no readable records or is empty.");
    [javac]                                                                                       
                   ^
    [javac] 1 error
----------------------------------------------------------

M Coffee

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: JSP Compiler error messages lower quality in Tomcat 5.5?

Posted by M Coffee <mr...@yahoo.com>.
Yoav -- thanks for this link.

The patch you referenced installs and runs, but doesn't solve the problem Tomcat 5 has with
showing where the JSP compiler error occurred.  We installed the patch on a Tomcat 5.5.12
instance, and it runs successfully, but the output for the same code snippet is still
uninformative:

------------------------------------------------------
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 7 in the jsp file: /adminArea/UploadFile.jsp
Generated servlet error:
Syntax error on token ")", delete this token


	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:474)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 7 in the jsp file: /adminArea/UploadFile.jsp
Generated servlet error:
Syntax error on token ")", delete this token


	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300)
-------------------------------------------------------------

In reading the Bugzilla reference you included, I see that there are more layers of indirection
between the compiler and the Tomcat output -- with even more added in later releases of Tomcat 5.5
-- so that is probably the issue:  someone didn't propagate the full compiler error information up
the stack.

Has anyone looked at this, or can someone point me at the likely spot to collect the correct
information from the JSP compiler so that I could start trying to build a patch?

Thanks,

M Coffee


--- Yoav Shapira <yo...@apache.org> wrote:

> Hi,
> 
> On 7/6/06, M Coffee <mr...@yahoo.com> wrote:
> > The quality of the JSP compiler error messages for Tomcat 5 seems much worse than >those for
> Tomcat
> 
> That's kind of funny: a few 5.5 releases ago I committed a patch
> suggested by someone to make JSP error messages much clearer ;)  I
> think it was for release 5.5.15 and the relevant Bugzilla issue is
> 37062: see it at
> http://issues.apache.org/bugzilla/show_bug.cgi?id=37062.
> 
> Obviously "clear" is a subjective term.  See if you like the Tomcat
> 5.5 behavior before 5.5.15 better or less than Tomcat 4, and let us
> know.  Then perhaps we can work on a patch together.
> 
> > Is there a way to build Tomcat with different components to have it provide better compiler >
> error messages?
> 
> Generically speaking, you can customize Tomcat any which way you want.
>  And if you find a setup that works better for you with regards to JSP
> error messages, we'd love to hear about it, see your patch, and
> hopefully include it in the product itself.
> 
> Yoav
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: JSP Compiler error messages lower quality in Tomcat 5.5?

Posted by Yoav Shapira <yo...@apache.org>.
Hi,

On 7/6/06, M Coffee <mr...@yahoo.com> wrote:
> The quality of the JSP compiler error messages for Tomcat 5 seems much worse than >those for Tomcat

That's kind of funny: a few 5.5 releases ago I committed a patch
suggested by someone to make JSP error messages much clearer ;)  I
think it was for release 5.5.15 and the relevant Bugzilla issue is
37062: see it at
http://issues.apache.org/bugzilla/show_bug.cgi?id=37062.

Obviously "clear" is a subjective term.  See if you like the Tomcat
5.5 behavior before 5.5.15 better or less than Tomcat 4, and let us
know.  Then perhaps we can work on a patch together.

> Is there a way to build Tomcat with different components to have it provide better compiler > error messages?

Generically speaking, you can customize Tomcat any which way you want.
 And if you find a setup that works better for you with regards to JSP
error messages, we'd love to hear about it, see your patch, and
hopefully include it in the product itself.

Yoav

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