tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1236906 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/WEB-INF/web.xml
Date Fri, 27 Jan 2012 22:06:06 GMT
Author: markt
Date: Fri Jan 27 22:06:05 2012
New Revision: 1236906

URL: http://svn.apache.org/viewvc?rev=1236906&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52511
Don't log an exception just because WEB-INF/classes does not exist

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/trunk/webapps/docs/WEB-INF/web.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1236906&r1=1236905&r2=1236906&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Jan 27 22:06:05 2012
@@ -43,6 +43,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.naming.Binding;
+import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.servlet.ServletContainerInitializer;
@@ -1194,14 +1195,19 @@ public class ContextConfig implements Li
                 // Step 4. Process /WEB-INF/classes for annotations
                 // This will add any matching classes to the typeInitializerMap
                 if (ok) {
+                    NamingEnumeration<Binding> listBindings = null;
                     try {
-                        NamingEnumeration<Binding> listBindings =
-                            context.getResources().listBindings("/WEB-INF/classes");
-                        while (listBindings.hasMoreElements()) {
+                        try {
+                            listBindings = context.getResources().listBindings(
+                                    "/WEB-INF/classes");
+                        } catch (NameNotFoundException ignore) {
+                            // Safe to ignore
+                        }
+                        while (listBindings != null &&
+                                listBindings.hasMoreElements()) {
                             Binding binding = listBindings.nextElement();
                             if (binding.getObject() instanceof FileDirContext) {
-                                File webInfCLassDir =
-                                    new File(
+                                File webInfCLassDir = new File(
                                         ((FileDirContext) binding.getObject()).getDocBase());
                                 processAnnotationsFile(webInfCLassDir, webXml);
                             }

Modified: tomcat/trunk/webapps/docs/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/WEB-INF/web.xml?rev=1236906&r1=1236905&r2=1236906&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/WEB-INF/web.xml (original)
+++ tomcat/trunk/webapps/docs/WEB-INF/web.xml Fri Jan 27 22:06:05 2012
@@ -20,7 +20,7 @@
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                       http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   version="3.0"
-  metadata-complete="true">
+  metadata-complete="false">
 
   <display-name>Tomcat Documentation</display-name>
   <description>



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


Mime
View raw message