tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1810283 - in /tomcat/tc8.0.x/trunk: ./ bin/ res/ webapps/docs/
Date Sun, 01 Oct 2017 21:19:54 GMT
Author: markt
Date: Sun Oct  1 21:19:54 2017
New Revision: 1810283

URL: http://svn.apache.org/viewvc?rev=1810283&view=rev
Log:
Improved handling of endorsed directories for Java 9.
Patch by rjung.

Modified:
    tomcat/tc8.0.x/trunk/RELEASE-NOTES
    tomcat/tc8.0.x/trunk/RUNNING.txt
    tomcat/tc8.0.x/trunk/bin/catalina.bat
    tomcat/tc8.0.x/trunk/bin/catalina.sh
    tomcat/tc8.0.x/trunk/bin/daemon.sh
    tomcat/tc8.0.x/trunk/bin/service.bat
    tomcat/tc8.0.x/trunk/bin/setclasspath.bat
    tomcat/tc8.0.x/trunk/bin/setclasspath.sh
    tomcat/tc8.0.x/trunk/bin/tool-wrapper.bat
    tomcat/tc8.0.x/trunk/bin/tool-wrapper.sh
    tomcat/tc8.0.x/trunk/res/tomcat.nsi
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
    tomcat/tc8.0.x/trunk/webapps/docs/class-loader-howto.xml

Modified: tomcat/tc8.0.x/trunk/RELEASE-NOTES
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/RELEASE-NOTES?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/RELEASE-NOTES (original)
+++ tomcat/tc8.0.x/trunk/RELEASE-NOTES Sun Oct  1 21:19:54 2017
@@ -93,7 +93,7 @@ or by placing them in JAR files in the "
 
 To override the XML parser implementation or interfaces, use the endorsed
 mechanism of the JVM. The default configuration defines JARs located in
-"endorsed" as endorsed.
+"endorsed" as endorsed. This mechanism is no longer supported with Java 9.
 
 
 ================================================================

Modified: tomcat/tc8.0.x/trunk/RUNNING.txt
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/RUNNING.txt?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/RUNNING.txt (original)
+++ tomcat/tc8.0.x/trunk/RUNNING.txt Sun Oct  1 21:19:54 2017
@@ -275,6 +275,7 @@ In CATALINA_HOME:
  * endorsed - Libraries that override standard "Endorsed Standards"
               libraries provided by JRE. See Classloading documentation
               in the User Guide for details.
+              No longer supported with Java 9.
 
               By default this "endorsed" directory is absent.
 

Modified: tomcat/tc8.0.x/trunk/bin/catalina.bat
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/catalina.bat?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/catalina.bat (original)
+++ tomcat/tc8.0.x/trunk/bin/catalina.bat Sun Oct  1 21:19:54 2017
@@ -67,6 +67,7 @@ rem   JAVA_ENDORSED_DIRS (Optional) List
 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                   Note that Java 9 no longer supports this feature.
 rem                   Defaults to $CATALINA_HOME/endorsed.
 rem
 rem   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
@@ -221,6 +222,19 @@ if not "%LOGGING_MANAGER%" == "" goto no
 set LOGGING_MANAGER=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 :noJuliManager
 
+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%"
@@ -337,17 +351,17 @@ goto setArgs
 rem Execute Java with the applicable properties
 if not "%JPDA%" == "" goto doJpda
 if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
-%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%"
-classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%"
-Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
+%_EXECJAVA% %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%
 goto end
 :doSecurity
-%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%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% %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%
 goto end
 :doJpda
 if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
-%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS%
-Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%"
-Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS%
%ACTION%
+%_EXECJAVA% %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%
 goto end
 :doSecurityJpda
-%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS%
-Djava.endorsed.dirs="%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% %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%
 goto end
 
 :end

Modified: tomcat/tc8.0.x/trunk/bin/catalina.sh
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/catalina.sh?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/catalina.sh (original)
+++ tomcat/tc8.0.x/trunk/bin/catalina.sh Sun Oct  1 21:19:54 2017
@@ -62,6 +62,7 @@
 #                   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.
+#                   Note that Java 9 no longer supports this feature.
 #                   Defaults to $CATALINA_HOME/endorsed.
 #
 #   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
@@ -263,6 +264,18 @@ if [ -z "$LOGGING_MANAGER" ]; then
   LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
 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
+
 # Uncomment the following line to make the umask available when using the
 # org.apache.catalina.security.SecurityListener
 #JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"
@@ -326,7 +339,8 @@ if [ "$1" = "debug" ] ; then
       fi
       shift
       exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
-        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
+        -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
+        -classpath "$CLASSPATH" \
         -sourcepath "$CATALINA_HOME"/../../java \
         -Djava.security.manager \
         -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
@@ -336,7 +350,8 @@ if [ "$1" = "debug" ] ; then
         org.apache.catalina.startup.Bootstrap "$@" start
     else
       exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
-        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
+        -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
+        -classpath "$CLASSPATH" \
         -sourcepath "$CATALINA_HOME"/../../java \
         -Dcatalina.base="$CATALINA_BASE" \
         -Dcatalina.home="$CATALINA_HOME" \
@@ -354,7 +369,8 @@ elif [ "$1" = "run" ]; then
     fi
     shift
     eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS
\
-      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+      -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+      -classpath "\"$CLASSPATH\"" \
       -Djava.security.manager \
       -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \
       -Dcatalina.base="\"$CATALINA_BASE\"" \
@@ -363,7 +379,8 @@ elif [ "$1" = "run" ]; then
       org.apache.catalina.startup.Bootstrap "$@" start
   else
     eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS
\
-      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+      -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+      -classpath "\"$CLASSPATH\"" \
       -Dcatalina.base="\"$CATALINA_BASE\"" \
       -Dcatalina.home="\"$CATALINA_HOME\"" \
       -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
@@ -420,7 +437,8 @@ elif [ "$1" = "start" ] ; then
     fi
     shift
     eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS
\
-      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+      -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+      -classpath "\"$CLASSPATH\"" \
       -Djava.security.manager \
       -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \
       -Dcatalina.base="\"$CATALINA_BASE\"" \
@@ -431,7 +449,8 @@ elif [ "$1" = "start" ] ; then
 
   else
     eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS
\
-      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+      -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+      -classpath "\"$CLASSPATH\"" \
       -Dcatalina.base="\"$CATALINA_BASE\"" \
       -Dcatalina.home="\"$CATALINA_HOME\"" \
       -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
@@ -483,7 +502,8 @@ elif [ "$1" = "stop" ] ; then
   fi
 
   eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \
-    -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+    -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+    -classpath "\"$CLASSPATH\"" \
     -Dcatalina.base="\"$CATALINA_BASE\"" \
     -Dcatalina.home="\"$CATALINA_HOME\"" \
     -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
@@ -569,7 +589,8 @@ elif [ "$1" = "stop" ] ; then
 elif [ "$1" = "configtest" ] ; then
 
     eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \
-      -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
+      -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
+      -classpath "\"$CLASSPATH\"" \
       -Dcatalina.base="\"$CATALINA_BASE\"" \
       -Dcatalina.home="\"$CATALINA_HOME\"" \
       -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \

Modified: tomcat/tc8.0.x/trunk/bin/daemon.sh
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/daemon.sh?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/daemon.sh (original)
+++ tomcat/tc8.0.x/trunk/bin/daemon.sh Sun Oct  1 21:19:54 2017
@@ -181,6 +181,18 @@ if [ "$cygwin" = "false" ]; then
     fi
 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
+
 # ----- Execute The Requested Command -----------------------------------------
 case "$1" in
     run     )
@@ -195,7 +207,7 @@ case "$1" in
       -errfile "&2" \
       -classpath "$CLASSPATH" \
       "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
-      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
+      -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
       -Dcatalina.base="$CATALINA_BASE" \
       -Dcatalina.home="$CATALINA_HOME" \
       -Djava.io.tmpdir="$CATALINA_TMP" \
@@ -212,7 +224,7 @@ case "$1" in
       -errfile "&1" \
       -classpath "$CLASSPATH" \
       "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
-      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
+      -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
       -Dcatalina.base="$CATALINA_BASE" \
       -Dcatalina.home="$CATALINA_HOME" \
       -Djava.io.tmpdir="$CATALINA_TMP" \
@@ -224,7 +236,7 @@ case "$1" in
       -stop \
       -pidfile "$CATALINA_PID" \
       -classpath "$CLASSPATH" \
-      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
+      -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
       -Dcatalina.base="$CATALINA_BASE" \
       -Dcatalina.home="$CATALINA_HOME" \
       -Djava.io.tmpdir="$CATALINA_TMP" \

Modified: tomcat/tc8.0.x/trunk/bin/service.bat
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/service.bat?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/service.bat (original)
+++ tomcat/tc8.0.x/trunk/bin/service.bat Sun Oct  1 21:19:54 2017
@@ -77,6 +77,19 @@ rem Set default Service name
 set SERVICE_NAME=Tomcat@VERSION_MAJOR@
 set DISPLAYNAME=Apache Tomcat @VERSION_MAJOR_MINOR@ %SERVICE_NAME%
 
+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
+
 if "x%1x" == "xx" goto displayUsage
 set SERVICE_CMD=%1
 shift
@@ -159,7 +172,7 @@ if not "%CATALINA_HOME%" == "%CATALINA_B
     --StopClass org.apache.catalina.startup.Bootstrap ^
     --StartParams start ^
     --StopParams stop ^
-    --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.endorsed.dirs=%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"
^
+    --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"
^
     --JvmMs 128 ^
     --JvmMx 256
 if not errorlevel 1 goto installed

Modified: tomcat/tc8.0.x/trunk/bin/setclasspath.bat
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/setclasspath.bat?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/setclasspath.bat (original)
+++ tomcat/tc8.0.x/trunk/bin/setclasspath.bat Sun Oct  1 21:19:54 2017
@@ -67,7 +67,10 @@ 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 Set the default -Djava.endorsed.dirs argument
+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
 

Modified: tomcat/tc8.0.x/trunk/bin/setclasspath.sh
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/setclasspath.sh?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/setclasspath.sh (original)
+++ tomcat/tc8.0.x/trunk/bin/setclasspath.sh Sun Oct  1 21:19:54 2017
@@ -79,8 +79,12 @@ fi
 
 # Don't override the endorsed dir if the user has set it previously
 if [ -z "$JAVA_ENDORSED_DIRS" ]; then
-  # Set the default -Djava.endorsed.dirs argument
-  JAVA_ENDORSED_DIRS="$CATALINA_HOME"/endorsed
+  # 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.
@@ -91,4 +95,4 @@ if [ "$os400" != "true" ]; then
   if [ -z "$_RUNJDB" ]; then
     _RUNJDB="$JAVA_HOME"/bin/jdb
   fi
-fi
\ No newline at end of file
+fi

Modified: tomcat/tc8.0.x/trunk/bin/tool-wrapper.bat
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/tool-wrapper.bat?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/tool-wrapper.bat (original)
+++ tomcat/tc8.0.x/trunk/bin/tool-wrapper.bat Sun Oct  1 21:19:54 2017
@@ -36,6 +36,7 @@ rem   JAVA_ENDORSED_DIRS (Optional) List
 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                   Note that Java 9 no longer supports this feature.
 rem                   Defaults to $CATALINA_HOME/endorsed.
 rem ---------------------------------------------------------------------------
 
@@ -82,6 +83,19 @@ set "CLASSPATH=%CLASSPATH%%CATALINA_HOME
 
 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
@@ -91,6 +105,6 @@ shift
 goto setArgs
 :doneSetArgs
 
-%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath
"%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
+%_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%
 
 :end

Modified: tomcat/tc8.0.x/trunk/bin/tool-wrapper.sh
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/bin/tool-wrapper.sh?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/bin/tool-wrapper.sh (original)
+++ tomcat/tc8.0.x/trunk/bin/tool-wrapper.sh Sun Oct  1 21:19:54 2017
@@ -37,6 +37,7 @@
 #                   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.
+#                   Note that Java 9 no longer supports this feature.
 #                   Defaults to $CATALINA_HOME/endorsed.
 # -----------------------------------------------------------------------------
 
@@ -129,11 +130,24 @@ if $cygwin; then
   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"
 
 # ----- Execute The Requested Command -----------------------------------------
 
 exec "$_RUNJAVA" $JAVA_OPTS $TOOL_OPTS \
-  -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
+  -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
+  -classpath "$CLASSPATH" \
   -Dcatalina.home="$CATALINA_HOME" \
   org.apache.catalina.startup.Tool "$@"

Modified: tomcat/tc8.0.x/trunk/res/tomcat.nsi
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/res/tomcat.nsi?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/res/tomcat.nsi (original)
+++ tomcat/tc8.0.x/trunk/res/tomcat.nsi Sun Oct  1 21:19:54 2017
@@ -319,7 +319,7 @@ Section -post
   ${If} $ServiceInstallLog != ""
     FileWrite $ServiceInstallLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName
--Classpath "$INSTDIR\bin\bootstrap.jar;$INSTDIR\bin\tomcat-juli.jar" --StartClass org.apache.catalina.startup.Bootstrap
--StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop  --StartMode
jvm --StopMode jvm'
     FileWrite $ServiceInstallLog "$\r$\n"
-    FileWrite $ServiceInstallLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName
--JvmOptions "-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.endorsed.dirs=$INSTDIR\endorsed#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties"'
+    FileWrite $ServiceInstallLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName
--JvmOptions "-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties"'
     FileWrite $ServiceInstallLog "$\r$\n"
     FileWrite $ServiceInstallLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName
--StdOutput auto --StdError auto --JvmMs 128 --JvmMx 256'
     FileWrite $ServiceInstallLog "$\r$\n"
@@ -328,7 +328,7 @@ Section -post
 
   DetailPrint "Configuring $TomcatServiceName service"
   nsExec::ExecToLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName --Classpath
"$INSTDIR\bin\bootstrap.jar;$INSTDIR\bin\tomcat-juli.jar" --StartClass org.apache.catalina.startup.Bootstrap
--StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop  --StartMode
jvm --StopMode jvm'
-  nsExec::ExecToLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName --JvmOptions
"-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.endorsed.dirs=$INSTDIR\endorsed#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties"'
+  nsExec::ExecToLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName --JvmOptions
"-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties"'
   nsExec::ExecToLog '"$INSTDIR\bin\$TomcatServiceFileName" //US//$TomcatServiceName --StdOutput
auto --StdError auto --JvmMs 128 --JvmMx 256'
 
   ${If} $TomcatShortcutAllUsers == "1"

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Sun Oct  1 21:19:54 2017
@@ -51,6 +51,14 @@
         Improve the fix for <bug>61439</bug> and exclude the JPA, JAX-WS and
EJB
         annotations completely from the Tomcat distributions. (markt)
       </fix>
+      <fix>
+        Improve handling of endorsed directories. The endorsed directory
+        mechanism will only be used if the <code>JAVA_ENDORSED_DIRS</code>
+        system property is explictly set or if
+        <code>$CATALINA_HOME/endorsed</code> exists. When running on Java 9,
any
+        such attempted use of the endorsed directory mechanism will trigger an
+        error and Tomcat will fail to start. (rjung)
+      </fix>
     </changelog>
   </subsection>
 </section>

Modified: tomcat/tc8.0.x/trunk/webapps/docs/class-loader-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/class-loader-howto.xml?rev=1810283&r1=1810282&r2=1810283&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/class-loader-howto.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/class-loader-howto.xml Sun Oct  1 21:19:54 2017
@@ -177,8 +177,8 @@ class from the web application's <em>Web
 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. For some classes (such as
-the XML parser components in J2SE 1.4+), the J2SE 1.4 endorsed feature can be
-used.
+the XML parser components in J2SE 1.4+), the Java endorsed feature can be
+used up to Java 8.
 Lastly, the web application class loader will always delegate first for JavaEE
 API classes for the specifications implemented by Tomcat
 (Servlet, JSP, EL, WebSocket). All other class loaders in Tomcat follow the
@@ -233,7 +233,11 @@ http://docs.oracle.com/javase/1.5.0/docs
 <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.</p>
+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>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



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


Mime
View raw message