Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59866
Don't scan WEB-INF/classes/META-INF/resources unnecessarily.
Note only the first issue in the bug report applies to 8.0.x.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk@1754946 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java
index 487e1bb..34da24e 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1144,6 +1144,11 @@
                         context.getResources().listResources("/WEB-INF/classes");
 
                 for (WebResource webResource : webResources) {
+                    // Skip the META-INF directory from any JARs that have been
+                    // expanded in to WEB-INF/classes (sometimes IDEs do this).
+                    if ("META-INF".equals(webResource.getName())) {
+                        continue;
+                    }
                     processAnnotationsWebResource(webResource, webXml,
                             webXml.isMetadataComplete());
                 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b488a0c..d36d40a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,6 +125,12 @@
         <bug>59824</bug>: Mark the <code>RewriteValve</code> as supporting async
         processing by default. (markt)
       </fix>
+      <fix>
+        <bug>59866</bug>: When scanning <code>WEB-INF/classes</code> for
+        annotations, don't scan the contents of
+        <code>WEB-INF/classes/META-INF</code> (if present) since classes will
+        never be loaded from that location. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">