Bug 49665 - When file not found error occurs it does not tell you which file caused the error.
Summary: When file not found error occurs it does not tell you which file caused the e...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.29
Hardware: PC All
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-29 05:08 UTC by Ted Leung
Modified: 2010-10-28 20:39 UTC (History)
0 users



Attachments
Patch to jasper so file not found error while parsing tld's report file and location. (1.80 KB, patch)
2010-07-29 05:08 UTC, Ted Leung
Details | Diff
patch to file not found reports the file that caused the error. (2.43 KB, patch)
2010-07-29 05:59 UTC, Ted Leung
Details | Diff
patch to show jsp filename and location causing error (3.27 KB, patch)
2010-07-29 17:53 UTC, Ted Leung
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Leung 2010-07-29 05:08:43 UTC
Created attachment 25814 [details]
Patch to jasper so file not found error while parsing tld's report file and location.

When parsing jsp's into java, if a "file not found" occurrs like on a tag file it will not tell you which file caused the error.

As an example : 
------------------------
   [jasper] Jul 29, 2010 7:02:24 PM org.apache.jasper.JspC processFile
   [jasper] SEVERE: File "/tags/struts-bean" not found
   [jasper] Jul 29, 2010 7:02:25 PM org.apache.jasper.JspC processFile
   [jasper] SEVERE: file:/data/cvs/oscar_mcmaster/build/tmp/jspc/web/ticklerPlus/preparedTicklerList.jsp(22,18) Attribute value request.getAttribute("preparedTicklers") is quoted with " which must be escaped when used within the value
------------------------

There are 2 errors showing here, one is from an invalid tag and the other is on an attribute. Note that the attribute works well and tells me which file and location is causing the problem. Note that with the first error it doesn't even tell me which file is causing the error.

Attached is a patch which shows the file and location of the error. After the patch file is applied I get a more useful out put

-------------------------
   [jasper] Jul 29, 2010 6:54:11 PM org.apache.jasper.JspC processFile
   [jasper] SEVERE: file:/data/cvs/oscar_mcmaster/build/tmp/jspc/web/ticklerPlus/Auth.jsp(1,49) File "/tags/struts-bean" not found
   [jasper] Jul 29, 2010 6:54:11 PM org.apache.jasper.JspC processFile
   [jasper] SEVERE: file:/data/cvs/oscar_mcmaster/build/tmp/jspc/web/ticklerPlus/preparedTicklerList.jsp(22,18) Attribute value request.getAttribute("preparedTicklers") is quoted with " which must be escaped when used within the value
-------------------------
Comment 1 Ted Leung 2010-07-29 05:10:22 UTC
The previously uploaded patch was made off of svn "tc6.0.x 966937"
Comment 2 Ted Leung 2010-07-29 05:59:10 UTC
Created attachment 25815 [details]
patch to file not found reports the file that caused the error.

previous patch attachment was missing a file, this should work better
Comment 3 Ted Leung 2010-07-29 17:53:37 UTC
Created attachment 25816 [details]
patch to show jsp filename and location causing error

This patch file has a fix to show the filename and location for the taglib file not found as well as "Name was not previously introduced as per JSP.5.3" errors.

This is a cumulative patch so the previous patches are now obsolete.
Comment 4 Mark Thomas 2010-09-28 13:24:25 UTC
Thanks for the patch. I have applied it to 7.0.x and it will be included in 7.0.3 onwards.

I have also proposed it for 6.0.x.
Comment 5 Konstantin Kolinko 2010-10-28 20:39:15 UTC
Fixed in 6.0 by r1028562, will be in 6.0.30.