You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/01/16 11:37:37 UTC

[tomcat] branch 8.5.x updated (c2efdb6 -> 4544de0)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from c2efdb6  Align with 9.0.x and master
     new 8a7384d  https://bz.apache.org/bugzilla/show_bug.cgi?id=64021 SCI ordering
     new 4544de0  Correct ordering

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../catalina/startup/WebappServiceLoader.java      | 29 ++++++++++++++-----
 webapps/docs/changelog.xml                         | 33 ++++++++++++++++------
 2 files changed, 46 insertions(+), 16 deletions(-)


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


[tomcat] 01/02: https://bz.apache.org/bugzilla/show_bug.cgi?id=64021 SCI ordering

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 8a7384de384345b2372a73b677e35bb0f817920b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 16 11:10:13 2020 +0000

    https://bz.apache.org/bugzilla/show_bug.cgi?id=64021 SCI ordering
    
    Ensure that container provided SCIs are always loaded before application
    provided SCIs. Where both container and application provide the same
    SCI, the application takes priority.
    SCI definitions from JARS unpacked into WEB-INF/classes are now handled
    consistently and will always be found irrespective of whether the web
    application defines a JAR ordering or not.
---
 .../catalina/startup/WebappServiceLoader.java      | 29 ++++++++++++++++------
 webapps/docs/changelog.xml                         | 11 ++++++++
 2 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/startup/WebappServiceLoader.java b/java/org/apache/catalina/startup/WebappServiceLoader.java
index a47a8f9..d6b7623 100644
--- a/java/org/apache/catalina/startup/WebappServiceLoader.java
+++ b/java/org/apache/catalina/startup/WebappServiceLoader.java
@@ -34,6 +34,7 @@ import java.util.regex.Pattern;
 import javax.servlet.ServletContext;
 
 import org.apache.catalina.Context;
+import org.apache.catalina.WebResource;
 import org.apache.tomcat.util.scan.JarFactory;
 
 /**
@@ -58,6 +59,7 @@ import org.apache.tomcat.util.scan.JarFactory;
  * @see java.util.ServiceLoader
  */
 public class WebappServiceLoader<T> {
+    private static final String CLASSES = "/WEB-INF/classes/";
     private static final String LIB = "/WEB-INF/lib/";
     private static final String SERVICES = "META-INF/services/";
 
@@ -99,10 +101,23 @@ public class WebappServiceLoader<T> {
         // if the ServletContext has ORDERED_LIBS, then use that to specify the
         // set of JARs from WEB-INF/lib that should be used for loading services
         @SuppressWarnings("unchecked")
-        List<String> orderedLibs =
-                (List<String>) servletContext.getAttribute(ServletContext.ORDERED_LIBS);
-        if (orderedLibs != null) {
-            // handle ordered libs directly, ...
+        List<String> orderedLibs = (List<String>) servletContext.getAttribute(ServletContext.ORDERED_LIBS);
+
+        // Handle application SCIs directly...
+        if (orderedLibs == null) {
+            // No ordered libs, so use every service definition we can find
+            WebResource[] resources = context.getResources().getClassLoaderResources("/" + configFile);
+            for (WebResource resource : resources) {
+                if (resource.isFile()) {
+                    parseConfigFile(applicationServicesFound, resource.getURL());
+                }
+            }
+        } else {
+            // Ordered libs so only use services defined in those libs and any
+            // in WEB-INF/classes
+            URL unpacked = servletContext.getResource(CLASSES + configFile);
+            parseConfigFile(applicationServicesFound, unpacked);
+
             for (String lib : orderedLibs) {
                 URL jarUrl = servletContext.getResource(LIB + lib);
                 if (jarUrl == null) {
@@ -123,11 +138,11 @@ public class WebappServiceLoader<T> {
                     // no provider file found, this is OK
                 }
             }
-
-            // and the parent ClassLoader for all others
-            loader = context.getParentClassLoader();
         }
 
+        // and use the parent ClassLoader for all other SCIs
+        loader = context.getParentClassLoader();
+
         Enumeration<URL> resources;
         if (loader == null) {
             resources = ClassLoader.getSystemResources(configFile);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 641bdfd..f8e24c7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -88,6 +88,17 @@
         (michaelo)
       </fix>
       <fix>
+        <bug>64021</bug>: Ensure that container provided SCIs are always loaded
+        before application provided SCIs. Note that where both the container and
+        the application provide the same SCI, it is the application provided SCI
+        that will be used. (markt)
+      </fix>
+      <fix>
+        SCI definitions from JARs unpacked into <code>WEB-INF/classes</code> are
+        now handled consistently and will always be found irrespective of
+        whether the web application defines a JAR ordering or not. (markt)
+      </fix>
+      <fix>
         <bug>64023</bug>: Skip null-valued session attributes when deserializing
         sessions. (schultz)
       </fix>


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


[tomcat] 02/02: Correct ordering

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 4544de01b8e07324f1e983b4c5379d5a63d82b6c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 16 11:11:59 2020 +0000

    Correct ordering
---
 webapps/docs/changelog.xml | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f8e24c7..08b0425 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -61,6 +61,10 @@
         Avoid useless environment restore when not using GSSCredential
         in JNDIRealm. (remm)
       </fix>
+      <fix>
+        <bug>58577</bug>: Respect the argument-count when searching for MBean
+        operations to invoke via the JMXProxyServlet. (schultz)
+      </fix>
       <add>
         <bug>62755</bug>: Add ability to opt out of adding the default web.xml
         config when embedding Tomcat and adding a context via
@@ -68,6 +72,11 @@
         <code>setAddDefaultWebXmlToWebapp(false)</code> to prevent the automatic
         config. (isapir/markt)
       </add>
+      <update>
+        <bug>63691</bug>: Skip all jar and directory scanning when the wildcard
+        pattern &quot;*&quot; or &quot;*.jar&quot; is set or added to
+        <code>tomcat.util.scan.StandardJarScanFilter.jarsToSkip</code>. (isapir)
+      </update>
       <fix>
         <bug>64005</bug>: Correct a regression in the static resource caching
         changes introduced in 8.5.28. Avoid a <code>NullPointerException</code>
@@ -102,19 +111,14 @@
         <bug>64023</bug>: Skip null-valued session attributes when deserializing
         sessions. (schultz)
       </fix>
-      <update>
-        <bug>63691</bug>: Skip all jar and directory scanning when the wildcard
-        pattern &quot;*&quot; or &quot;*.jar&quot; is set or added to
-        <code>tomcat.util.scan.StandardJarScanFilter.jarsToSkip</code>. (isapir)
-      </update>
       <fix>
         Do not throw a NullPointerException when an MBean or operation cannot
         be found by the JMXProxyServlet. (schultz)
       </fix>
-      <fix>
-        <bug>58577</bug>: Respect the argument-count when searching for MBean
-        operations to invoke via the JMXProxyServlet. (schultz)
-      </fix>
+      <update>
+        <bug>64067</bug>: Allow more than one parameter when defining RewriteMaps.
+        (fschumacher)
+      </update>
       <fix>
         <bug>64074</bug>: <code>InputStream</code>s for directories obtained
         from resource URLs now return a directory listing consistent with the


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