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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new d391a95  Avoid InaccessibleObjectException on Java 16
d391a95 is described below

commit d391a95b1d97f1fceaf07a728035e4f0e44aa9d2
Author: remm <r...@apache.org>
AuthorDate: Mon Dec 14 09:33:10 2020 +0100

    Avoid InaccessibleObjectException on Java 16
---
 java/org/apache/catalina/loader/WebappClassLoaderBase.java | 5 +++--
 webapps/docs/changelog.xml                                 | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index 3987d89..e64a278 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -1802,8 +1802,9 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
                                 usingExecutor = true;
                             }
                         }
-                    } catch (SecurityException | NoSuchFieldException | 
IllegalArgumentException |
-                            IllegalAccessException e) {
+                    } catch (NoSuchFieldException | IllegalAccessException | 
RuntimeException e) {
+                        // InaccessibleObjectException is only available in 
Java 9+,
+                        // swapped for RuntimeException
                         
log.warn(sm.getString("webappClassLoader.stopThreadFail",
                                 thread.getName(), getContextName()), e);
                     }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c470346..7e2c761 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -138,6 +138,10 @@
         be logged in the access log using the new <code>%{peer}a</code>
         syntax. (rjung)
       </add>
+      <fix>
+        Avoid uncaught InaccessibleObjectException on Java 16 trying to clear
+        references threads. (remm)
+      </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