Author: violetagg
Date: Wed Dec 18 19:48:53 2013
New Revision: 1552074

URL: http://svn.apache.org/r1552074
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55905
Merged revision 1552071 from tomcat/trunk:
Prevent NPE when the specified tld resource does not exists.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1552071

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1552074&r1=1552073&r2=1552074&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties 
Wed Dec 18 19:48:53 2013
@@ -126,7 +126,8 @@ tldConfig.jarFail=Failed to process JAR 
 tldConfig.webinfFail=Failed to process TLD found at [{0}]
 tldConfig.webinfScan=Scanning WEB-INF for TLD files in [{0}]
 tldConfig.webxmlAdd=Adding path [{0}] for URI [{1}]
-tldConfig.webxmlFail=Failed to process TLD with path [{1}] and URI [{0}]
+tldConfig.webxmlFail=Failed to process TLD with path [{0}] and URI [{1}]
+tldConfig.webxmlFailPathDoesNotExist=Failed to process TLD with path [{0}] and 
URI [{1}]. The specified path does not exist.
 tldConfig.webxmlSkip=Path [{1}] skipped since URI [{0}] is a duplicate
 tldConfig.webxmlStart=Scanning <taglib> elements in web.xml
 userConfig.database=Exception loading user database

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=1552074&r1=1552073&r2=1552074&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java Wed 
Dec 18 19:48:53 2013
@@ -342,10 +342,15 @@ public final class TldConfig  implements
                 try {
                     stream = context.getServletContext().getResourceAsStream(
                             resourcePath);
-                    XmlErrorHandler handler = tldScanStream(stream);
-                    handler.logFindings(log, resourcePath);
-                    taglibUris.add(descriptor.getTaglibURI());
-                    webxmlTaglibUris.add(descriptor.getTaglibURI());
+                    if (stream != null) {
+                        XmlErrorHandler handler = tldScanStream(stream);
+                        handler.logFindings(log, resourcePath);
+                        taglibUris.add(descriptor.getTaglibURI());
+                        webxmlTaglibUris.add(descriptor.getTaglibURI());
+                    } else {
+                        
log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
+                                descriptor.getTaglibURI()));
+                    }
                 } catch (IOException ioe) {
                     log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                             descriptor.getTaglibURI()), ioe);

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1552074&r1=1552073&r2=1552074&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Dec 18 19:48:53 2013
@@ -81,6 +81,10 @@
         WebSocket Filter lazy so that it is not added to web applications that
         do not need it. (markt) 
       </fix>
+      <fix>
+        <bug>55905</bug>: Prevent a NPE when web.xml references a taglib file
+        that does not exist. Provide better error message. (violetagg)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to