Created attachment 24978 [details] patch to JspCompilationContext This is a pretty special case, since tagfiles in META-INF are usually in jar files... but when using a custom dircontext implementation (usually during development in order to load files from the filesystem without building a full jar) it may happen that the path given to jasper starts with META-INF also if the file is not in a jar. This is what happens using the Eclipse WTP tomcat loader, which loads classes from the workspaces and tld/tagfiles from directories inside your projects. Tagfiles contained in META-INF directories worked properly till tomcat 6.0.17, but the final fix for BUG 43741 broke it (I am still using 6.0.16 and not upgrading due to this problem). Looking at JspCompilationContext.getResource() the patch to solve this problem would be very simple and "safe": if the path starts with META-INF and a jar file containing the tld doesn't exist the resulting URL is simply null. Adding a check for the null jar and setting the URL to the "standard" path inside the context fixes the problem and everything starts working again (note that this doesn't break the previous fix and it can't cause any problem, since the result would have been null anyway). A patch against trunk (2010-02-13) is attached, the following code should easily displays what the patch does: URL result = null; if (res.startsWith("/META-INF/")) { // some lines to get the jar url // ... if (jarUrl != null) { result = new URL(jarUrl.toExternalForm() + res.substring(1)); } + else { + // the path starts with /META-INF but the file is not in a jar + result = context.getResource(canonicalURI(res)); + } }
Thanks for the patch. This has been fixed in trunk and proposed for 6.0.x
(In reply to comment #1) > Thanks for the patch. > > This has been fixed in trunk and proposed for 6.0.x great! Can you tell if it has been included in 6.0.26? I couldn't find a good way to guess this from bugzilla...
That would be what the 6.0.26 change log is for.
(In reply to comment #3) > That would be what the 6.0.26 change log is for. you are right, I'm too used with the "fixed versions" in jira... so it's not in 6.0.26, any chance to see it in a 6.0.x release soon? Thanks
Thanks again for the patch. This has been fixed in 6.0.x and will be included in 6.0.27 onwards.