tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41267] New: - NPE in TagLibraryInfoImpl for a declared tag files not in jar files
Date Sat, 30 Dec 2006 14:07:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41267>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41267

           Summary: NPE in TagLibraryInfoImpl for a declared tag files not
                    in jar files
           Product: Tomcat 5
           Version: 5.5.20
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: fgiust@apache.org


When a tld contains a tag-file definition with a path that starts with
"/META-INF/tags" TagLibraryInfoImpl immediately assumes the tld is contained in
a jar file (like it should, according to specifications), and causes a NPE if it
doesn't since the jar URL is null.

This is actually a minor problem since the tag doesn't have to be loaded anyway
(tag files with a path of "META-INF/tags" must be packaged in jar), but the NPE
thrown by TagLibraryInfoImpl is not very friendly (I just spent a couple of
hours before understanding where it came from).

The attached patch simply fix TagLibraryInfoImpl in order to avoid a NPE. If the
file is not available in TagFileJarUrls a better exception will already be
thrown when trying to use it. This patch is only needed for tomcat 5.5, tomcat
6.0 doesn't have this problem (no NPE, but the same exception you will get in
5.5 after this patch).

For reference, this is the stacktrace you get in a JSP page without this fix:

java.lang.NullPointerException
	java.util.Hashtable.put(Hashtable.java:396)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagFileInfo(TagLibraryInfoImpl.java:494)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:250)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
org.apache.jasper.compiler.JspDocumentParser.getTaglibInfo(JspDocumentParser.java:1259)
org.apache.jasper.compiler.JspDocumentParser.startPrefixMapping(JspDocumentParser.java:767)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startNamespaceMapping(AbstractSAXParser.java:2063)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:499)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
	com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message