This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new c9ea1d5 Remove all references to java.endorsed.dirs c9ea1d5 is described below commit c9ea1d5db0b04b0386b79e5cb0a467fb601c860a Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jul 28 17:28:09 2021 +0100 Remove all references to java.endorsed.dirs --- RELEASE-NOTES | 6 ++--- RUNNING.txt | 6 ----- bin/catalina.bat | 28 ++++-------------------- bin/catalina.sh | 28 ------------------------ bin/daemon.sh | 15 ------------- bin/service.bat | 15 +------------ bin/setclasspath.bat | 12 +--------- bin/setclasspath.sh | 13 +---------- bin/tool-wrapper.bat | 22 +------------------ bin/tool-wrapper.sh | 21 ------------------ java/org/apache/jasper/compiler/AntCompiler.java | 16 -------------- webapps/docs/changelog.xml | 4 ++++ webapps/docs/class-loader-howto.xml | 25 +++++---------------- webapps/docs/jndi-datasource-examples-howto.xml | 14 ++++++------ 14 files changed, 26 insertions(+), 199 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1a7b622..70e5abf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -92,10 +92,8 @@ You can make additional APIs available to all of your web applications by putting unpacked classes into a "classes" directory (not created by default), or by placing them in JAR files in the "lib" directory. -To override the XML parser implementation or interfaces, use the appropriate -feature for your JVM. For Java <= 8 use the endorsed standards override -feature. The default configuration defines JARs located in "endorsed" as endorsed. -For Java 9+ use the upgradeable modules feature. +To override the XML parser implementation or interfaces, use the upgradeable +modules feature. ================================================================ diff --git a/RUNNING.txt b/RUNNING.txt index a4b2d76..f96d8b9 100644 --- a/RUNNING.txt +++ b/RUNNING.txt @@ -272,12 +272,6 @@ In CATALINA_HOME: * lib - Libraries and classes, as explained below - * endorsed - Libraries that override standard "Endorsed Standards" - libraries provided by JRE. See Classloading documentation - in the User Guide for details. - This is only supported for Java <= 8. - By default this "endorsed" directory is absent. - In the default configuration the JAR libraries and classes both in CATALINA_BASE/lib and in CATALINA_HOME/lib will be added to the common classpath, but the ones in CATALINA_BASE will be added first and thus will diff --git a/bin/catalina.bat b/bin/catalina.bat index 20b06a0..6a322a7 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -65,13 +65,6 @@ rem should be used by Tomcat and also by the stop process, rem the version command etc. rem Most options should go into CATALINA_OPTS. rem -rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories -rem containing some jars in order to allow replacement of APIs -rem created outside of the JCP (i.e. DOM and SAX from W3C). -rem It can also be used to update the XML parser implementation. -rem This is only supported for Java <= 8. -rem Defaults to $CATALINA_HOME/endorsed. -rem rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" rem command is executed. The default is "dt_socket". rem @@ -231,19 +224,6 @@ set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util=ALL-UNN set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.util.concurrent=ALL-UNNAMED" set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" -rem Java 9 no longer supports the java.endorsed.dirs -rem system property. Only try to use it if -rem JAVA_ENDORSED_DIRS was explicitly set -rem or CATALINA_HOME/endorsed exists. -set ENDORSED_PROP=ignore.endorsed.dirs -if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar -set ENDORSED_PROP=java.endorsed.dirs -goto doneEndorsed -:noEndorsedVar -if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed -set ENDORSED_PROP=java.endorsed.dirs -:doneEndorsed - rem ----- Execute The Requested Command --------------------------------------- echo Using CATALINA_BASE: "%CATALINA_BASE%" @@ -361,17 +341,17 @@ goto setArgs rem Execute Java with the applicable properties if not "%JPDA%" == "" goto doJpda if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity -%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% +%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :doSecurity -%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% +%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :doJpda if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda -%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% +%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :doSecurityJpda -%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% +%_EXECJAVA% %CATALINA_LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% goto end :end diff --git a/bin/catalina.sh b/bin/catalina.sh index b77831b..57627bb 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -69,13 +69,6 @@ # the version command etc. # Most options should go into CATALINA_OPTS. # -# JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories -# containing some jars in order to allow replacement of APIs -# created outside of the JCP (i.e. DOM and SAX from W3C). -# It can also be used to update the XML parser implementation. -# This is only supported for Java <= 8. -# Defaults to $CATALINA_HOME/endorsed. -# # JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" # command is executed. The default is "dt_socket". # @@ -251,7 +244,6 @@ if $cygwin; then CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"` CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$JAVA_ENDORSED_DIRS" ] && JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` fi if [ -z "$JSSE_OPTS" ] ; then @@ -283,18 +275,6 @@ if [ -z "$UMASK" ]; then fi umask $UMASK -# Java 9 no longer supports the java.endorsed.dirs -# system property. Only try to use it if -# JAVA_ENDORSED_DIRS was explicitly set -# or CATALINA_HOME/endorsed exists. -ENDORSED_PROP=ignore.endorsed.dirs -if [ -n "$JAVA_ENDORSED_DIRS" ]; then - ENDORSED_PROP=java.endorsed.dirs -fi -if [ -d "$CATALINA_HOME/endorsed" ]; then - ENDORSED_PROP=java.endorsed.dirs -fi - # Make the umask available when using the org.apache.catalina.security.SecurityListener JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`" @@ -366,7 +346,6 @@ if [ "$1" = "debug" ] ; then fi shift eval exec "\"$_RUNJDB\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ -classpath "$CLASSPATH" \ -sourcepath "$CATALINA_HOME"/../../java \ -Djava.security.manager \ @@ -377,7 +356,6 @@ if [ "$1" = "debug" ] ; then org.apache.catalina.startup.Bootstrap "$@" start else eval exec "\"$_RUNJDB\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ -classpath "$CLASSPATH" \ -sourcepath "$CATALINA_HOME"/../../java \ -Dcatalina.base="$CATALINA_BASE" \ @@ -396,7 +374,6 @@ elif [ "$1" = "run" ]; then fi shift eval exec "\"$_RUNJAVA\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Djava.security.manager \ -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \ @@ -406,7 +383,6 @@ elif [ "$1" = "run" ]; then org.apache.catalina.startup.Bootstrap "$@" start else eval exec "\"$_RUNJAVA\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ @@ -477,7 +453,6 @@ elif [ "$1" = "start" ] ; then fi shift eval $_NOHUP "\"$_RUNJAVA\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Djava.security.manager \ -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \ @@ -489,7 +464,6 @@ elif [ "$1" = "start" ] ; then else eval $_NOHUP "\"$_RUNJAVA\"" "\"$CATALINA_LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ @@ -542,7 +516,6 @@ elif [ "$1" = "stop" ] ; then fi eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ @@ -629,7 +602,6 @@ elif [ "$1" = "stop" ] ; then elif [ "$1" = "configtest" ] ; then eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ diff --git a/bin/daemon.sh b/bin/daemon.sh index 946bbe7..b3a3363 100755 --- a/bin/daemon.sh +++ b/bin/daemon.sh @@ -189,18 +189,6 @@ if [ -z "$UMASK" ]; then fi umask $UMASK -# Java 9 no longer supports the java.endorsed.dirs -# system property. Only try to use it if -# JAVA_ENDORSED_DIRS was explicitly set -# or CATALINA_HOME/endorsed exists. -ENDORSED_PROP=ignore.endorsed.dirs -if [ -n "$JAVA_ENDORSED_DIRS" ]; then - ENDORSED_PROP=java.endorsed.dirs -fi -if [ -d "$CATALINA_HOME/endorsed" ]; then - ENDORSED_PROP=java.endorsed.dirs -fi - # ----- Execute The Requested Command ----------------------------------------- case "$1" in run ) @@ -216,7 +204,6 @@ case "$1" in -errfile "\"&2\"" \ -classpath "\"$CLASSPATH\"" \ "\"$CATALINA_LOGGING_CONFIG\"" "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ @@ -235,7 +222,6 @@ case "$1" in -errfile "\"&1\"" \ -classpath "\"$CLASSPATH\"" \ "\"$CATALINA_LOGGING_CONFIG\"" "$JAVA_OPTS" "$CATALINA_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ @@ -248,7 +234,6 @@ case "$1" in -stop \ -pidfile "\"$CATALINA_PID\"" \ -classpath "\"$CLASSPATH\"" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ diff --git a/bin/service.bat b/bin/service.bat index a1ab56d..e54a70e 100755 --- a/bin/service.bat +++ b/bin/service.bat @@ -133,19 +133,6 @@ if not "%CATALINA_BASE%" == "" goto gotBase set "CATALINA_BASE=%CATALINA_HOME%" :gotBase -rem Java 9 no longer supports the java.endorsed.dirs -rem system property. Only try to use it if -rem JAVA_ENDORSED_DIRS was explicitly set -rem or CATALINA_HOME/endorsed exists. -set ENDORSED_PROP=ignore.endorsed.dirs -if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar -set ENDORSED_PROP=java.endorsed.dirs -goto doneEndorsed -:noEndorsedVar -if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed -set ENDORSED_PROP=java.endorsed.dirs -:doneEndorsed - rem Process the requested command if /i %SERVICE_CMD% == install goto doInstall if /i %SERVICE_CMD% == remove goto doRemove @@ -225,7 +212,7 @@ if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" ( --StopClass org.apache.catalina.startup.Bootstrap ^ --StartParams start ^ --StopParams stop ^ - --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%" ^ + --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%" ^ --JvmOptions9 "--add-opens=java.base/java.lang=ALL-UNNAMED#--add-opens=java.base/java.io=ALL-UNNAMED#--add-opens=java.base/java.util=ALL-UNNAMED#--add-opens=java.base/java.util.concurrent=ALL-UNNAMED#--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" ^ --Startup "%SERVICE_STARTUP_MODE%" ^ --JvmMs "%JvmMs%" ^ diff --git a/bin/setclasspath.bat b/bin/setclasspath.bat index 12da138..41548ef 100755 --- a/bin/setclasspath.bat +++ b/bin/setclasspath.bat @@ -16,8 +16,7 @@ rem limitations under the License. rem --------------------------------------------------------------------------- rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings -rem are valid and consistent with the selected start-up options and set up the -rem endorsed directory. +rem are valid and consistent with the selected start-up options. rem --------------------------------------------------------------------------- rem Make sure prerequisite environment variables are set @@ -63,15 +62,6 @@ echo This environment variable is needed to run this program goto exit :okJava -rem Don't override the endorsed dir if the user has set it previously -if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir -rem Java 9 no longer supports the java.endorsed.dirs -rem system property. Only try to use it if -rem CATALINA_HOME/endorsed exists. -if not exist "%CATALINA_HOME%\endorsed" goto gotEndorseddir -set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed" -:gotEndorseddir - rem Don't override _RUNJAVA if the user has set it previously if not "%_RUNJAVA%" == "" goto gotRunJava rem Set standard command for invoking Java. diff --git a/bin/setclasspath.sh b/bin/setclasspath.sh index 4ae4b6a..b81bc19 100755 --- a/bin/setclasspath.sh +++ b/bin/setclasspath.sh @@ -17,8 +17,7 @@ # ----------------------------------------------------------------------------- # Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings -# are valid and consistent with the selected start-up options and set up the -# endorsed directory. +# are valid and consistent with the selected start-up options. # ----------------------------------------------------------------------------- # Make sure prerequisite environment variables are set @@ -77,16 +76,6 @@ if [ "$1" = "debug" ] ; then fi fi -# Don't override the endorsed dir if the user has set it previously -if [ -z "$JAVA_ENDORSED_DIRS" ]; then - # Java 9 no longer supports the java.endorsed.dirs - # system property. Only try to use it if - # CATALINA_HOME/endorsed exists. - if [ -d "$CATALINA_HOME"/endorsed ]; then - JAVA_ENDORSED_DIRS="$CATALINA_HOME"/endorsed - fi -fi - # Set standard commands for invoking Java, if not already set. if [ -z "$_RUNJAVA" ]; then _RUNJAVA="$JRE_HOME"/bin/java diff --git a/bin/tool-wrapper.bat b/bin/tool-wrapper.bat index 94de4fe..64f38a0 100755 --- a/bin/tool-wrapper.bat +++ b/bin/tool-wrapper.bat @@ -31,13 +31,6 @@ rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME rem are both set, JRE_HOME is used. rem rem JAVA_OPTS (Optional) Java runtime options. -rem -rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories -rem containing some jars in order to allow replacement of APIs -rem created outside of the JCP (i.e. DOM and SAX from W3C). -rem It can also be used to update the XML parser implementation. -rem This is only supported for Java <= 8. -rem Defaults to $CATALINA_HOME/endorsed. rem --------------------------------------------------------------------------- setlocal @@ -83,19 +76,6 @@ set "CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\ set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -rem Java 9 no longer supports the java.endorsed.dirs -rem system property. Only try to use it if -rem JAVA_ENDORSED_DIRS was explicitly set -rem or CATALINA_HOME/endorsed exists. -set ENDORSED_PROP=ignore.endorsed.dirs -if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar -set ENDORSED_PROP=java.endorsed.dirs -goto doneEndorsed -:noEndorsedVar -if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed -set ENDORSED_PROP=java.endorsed.dirs -:doneEndorsed - rem Get remaining unshifted command line arguments and save them in the set CMD_LINE_ARGS= :setArgs @@ -105,6 +85,6 @@ shift goto setArgs :doneSetArgs -%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS% +%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS% :end diff --git a/bin/tool-wrapper.sh b/bin/tool-wrapper.sh index 863ca49..5a7f4b2 100755 --- a/bin/tool-wrapper.sh +++ b/bin/tool-wrapper.sh @@ -32,13 +32,6 @@ # are both set, JRE_HOME is used. # # JAVA_OPTS (Optional) Java runtime options. -# -# JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories -# containing some jars in order to allow replacement of APIs -# created outside of the JCP (i.e. DOM and SAX from W3C). -# It can also be used to update the XML parser implementation. -# This is only supported for Java <= 8. -# Defaults to $CATALINA_HOME/endorsed. # ----------------------------------------------------------------------------- # OS specific support. $var _must_ be set to either true or false. @@ -127,19 +120,6 @@ if $cygwin; then JRE_HOME=`cygpath --absolute --windows "$JRE_HOME"` CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$JAVA_ENDORSED_DIRS" ] && JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` -fi - -# Java 9 no longer supports the java.endorsed.dirs -# system property. Only try to use it if -# JAVA_ENDORSED_DIRS was explicitly set -# or CATALINA_HOME/endorsed exists. -ENDORSED_PROP=ignore.endorsed.dirs -if [ -n "$JAVA_ENDORSED_DIRS" ]; then - ENDORSED_PROP=java.endorsed.dirs -fi -if [ -d "$CATALINA_HOME/endorsed" ]; then - ENDORSED_PROP=java.endorsed.dirs fi JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" @@ -147,7 +127,6 @@ JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLog # ----- Execute The Requested Command ----------------------------------------- eval exec "\"$_RUNJAVA\"" "$JAVA_OPTS" "$TOOL_OPTS" \ - -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \ org.apache.catalina.startup.Tool "$@" diff --git a/java/org/apache/jasper/compiler/AntCompiler.java b/java/org/apache/jasper/compiler/AntCompiler.java index 3e14bc7..d81eaa1 100644 --- a/java/org/apache/jasper/compiler/AntCompiler.java +++ b/java/org/apache/jasper/compiler/AntCompiler.java @@ -177,22 +177,6 @@ public class AntCompiler extends Compiler { info.append(" extension dir=" + exts + "\n"); } - // Add endorsed directories if any are specified and we're forking - // See Bugzilla 31257 - if(ctxt.getOptions().getFork()) { - String endorsed = System.getProperty("java.endorsed.dirs"); - if(endorsed != null) { - Javac.ImplementationSpecificArgument endorsedArg = - javac.createCompilerArg(); - endorsedArg.setLine("-J-Djava.endorsed.dirs=" + - quotePathList(endorsed)); - info.append(" endorsed dir=" + quotePathList(endorsed) + - "\n"); - } else { - info.append(" no endorsed dirs specified\n"); - } - } - // Configure the compiler object javac.setEncoding(javaEncoding); javac.setClasspath(path); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c561f20..4cbf894 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -149,6 +149,10 @@ remove Java 8 specific code now that the minimum Java version has been increased to 11. (markt) </scode> + <scode> + Remove all references to the endorsed standards override feature as it + is not supported in Java 11. (markt) + </scode> </changelog> </subsection> <subsection name="Coyote"> diff --git a/webapps/docs/class-loader-howto.xml b/webapps/docs/class-loader-howto.xml index f80fb6d..c2d7c2c 100644 --- a/webapps/docs/class-loader-howto.xml +++ b/webapps/docs/class-loader-howto.xml @@ -178,9 +178,8 @@ class from the web application's <em>WebappX</em> class loader is processed, this class loader will look in the local repositories <strong>first</strong>, instead of delegating before looking. There are exceptions. Classes which are part of the JRE base classes cannot be overridden. There are some exceptions -such as the XML parser components which can be overridden using the appropriate -JVM feature which is the endorsed standards override feature for Java <= 8 -and the upgradeable modules feature for Java 9+. +such as the XML parser components which can be overridden using the upgradeable +modules feature for Java 9+. Lastly, the web application class loader will always delegate first for Jakarta EE API classes for the specifications implemented by Tomcat (Servlet, JSP, EL, WebSocket). All other class loaders in Tomcat follow the @@ -224,23 +223,9 @@ when you are running modern versions of Java, because the usual class loader delegation process will always choose the implementation inside the JDK in preference to this one.</p> -<p>Java <= 8 supports a mechanism called the "Endorsed Standards Override -Mechanism" to allow replacement of APIs created outside of the JCP -(i.e. DOM and SAX from W3C). It can also be used to update the XML parser -implementation. For more information, see: -<a href="http://docs.oracle.com/javase/1.5.0/docs/guide/standards/index.html"> -http://docs.oracle.com/javase/1.5.0/docs/guide/standards/index.html</a>. For -Java 9+, use the upgradeable modules feature.</p> - -<p>Tomcat utilizes the endorsed mechanism by including the system property setting -<code>-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS</code> in the -command line that starts the container. The default value of this option is -<em>$CATALINA_HOME/endorsed</em>. This <em>endorsed</em> directory is not -created by default. Note that the endorsed feature is no longer supported -with Java 9 and the above system property will only be set if either the -directory <em>$CATALINA_HOME/endorsed</em> exists, or the variable -<code>JAVA_ENDORSED_DIRS</code> has been set. -</p> +<p>Java 9+ supports a mechanism called upgradeable modules to allow replacement +of APIs created outside of the JCP (i.e. DOM and SAX from W3C). It can also be +used to update the XML parser implementation.</p> <p>Note that overriding any JRE component carries risk. If the overriding component does not provide a 100% compatible API (e.g. the API provided by diff --git a/webapps/docs/jndi-datasource-examples-howto.xml b/webapps/docs/jndi-datasource-examples-howto.xml index 36b691f..60ea32f 100644 --- a/webapps/docs/jndi-datasource-examples-howto.xml +++ b/webapps/docs/jndi-datasource-examples-howto.xml @@ -87,13 +87,13 @@ that is included with Apache Tomcat solves this by triggering the driver scan during Tomcat startup. This is enabled by default. It means that only libraries visible to the common class loader and its parents will be scanned for database drivers. This include drivers in <code>$CATALINA_HOME/lib</code>, -<code>$CATALINA_BASE/lib</code>, the class path and (where the JRE supports it) -the endorsed directory. Drivers packaged in web applications (in -<code>WEB-INF/lib</code>) and in the shared class loader (where configured) will -not be visible and will not be loaded automatically. If you are considering -disabling this feature, note that the scan would be triggered by the first web -application that is using JDBC, leading to failures when this web application is -reloaded and for other web applications that rely on this feature. +<code>$CATALINA_BASE/lib</code>, the class path and the modeul path. Drivers +packaged in web applications (in <code>WEB-INF/lib</code>) and in the shared +class loader (where configured) will not be visible and will not be loaded +automatically. If you are considering disabling this feature, note that the scan +would be triggered by the first web application that is using JDBC, leading to +failures when this web application is reloaded and for other web applications +that rely on this feature. </p> <p>Thus, the web applications that have database drivers in their --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org