[572022] Tomcat cannot be started from Eclipse under Java 16
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/AddTomcat.md b/plugins/org.eclipse.jst.server.tomcat.core/AddTomcat.md index b4f5ccc..8fb3898 100644 --- a/plugins/org.eclipse.jst.server.tomcat.core/AddTomcat.md +++ b/plugins/org.eclipse.jst.server.tomcat.core/AddTomcat.md
@@ -41,5 +41,5 @@ 2. Add a new **fragment** to the **org.eclipse.wst.server.ui.wizardFragments** extension. ### Determining values for installable runtimes: - 1. For ostype linux: filecount = tar tvzf apache-tomcat-8.0.53.tar.gz|grep -v '\/$'|wc -l - 1. For ostype win32: filecount = unzip -l apache-tomcat-8.0.36-windows-x86.zip|grep -v '\/$'|grep 'apache-tomcat-8.0.36/'|wc -l + 1. For ostype win32: filecount = unzip -l apache-tomcat-10.0.6.zip|grep -v '\/$'|grep 'apache-tomcat-'|grep -v ^Archive|wc -l + 1. For other ostypes: filecount = tar tvzf apache-tomcat-10.0.6.tar.gz|grep -v '\/$'|wc -l
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml index dd455ec..016dba0 100644 --- a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml +++ b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
@@ -780,34 +780,34 @@ <runtime id="org.eclipse.jst.server.tomcat.runtime.90" licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt" - archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz" - archivePath="apache-tomcat-9.0.43" - archiveSize="11483588" + archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.46/bin/apache-tomcat-9.0.46.tar.gz" + archivePath="apache-tomcat-9.0.46" + archiveSize="11496577" fileCount="639" os="linux,macosx"/> <runtime id="org.eclipse.jst.server.tomcat.runtime.90" licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt" - archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.zip" - archivePath="apache-tomcat-9.0.43" - archiveSize="12022644" + archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.46/bin/apache-tomcat-9.0.46.zip" + archivePath="apache-tomcat-9.0.46" + archiveSize="12037488" fileCount="639" os="win32"/> <runtime id="org.eclipse.jst.server.tomcat.runtime.100" licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt" - archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-10/v10.0.4/bin/apache-tomcat-10.0.4.tar.gz" - archivePath="apache-tomcat-10.0.4" - archiveSize="11811329" + archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-10/v10.0.6/bin/apache-tomcat-10.0.6.tar.gz" + archivePath="apache-tomcat-10.0.6" + archiveSize="11822805" fileCount="642" os="linux,macosx"/> <runtime id="org.eclipse.jst.server.tomcat.runtime.100" licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt" - archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-10/v10.0.4/bin/apache-tomcat-10.0.4.zip" - archivePath="apache-tomcat-10.0.4" - archiveSize="12356103" + archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-10/v10.0.6/bin/apache-tomcat-10.0.6.zip" + archivePath="apache-tomcat-10.0.6" + archiveSize="12367163" fileCount="642" os="win32"/> </extension>
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java index 34c8862..500af23 100644 --- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java +++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2018 IBM Corporation and others. + * Copyright (c) 2003, 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -52,6 +52,12 @@ "-Dcom.sun.management.jmxremote.ssl=", "-Dcom.sun.management.jmxremote.authenticate=" }; + private static final String[] ALLOW_REFLECTION_ARGS = new String[] { + "--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"}; // the thread used to ping the server to check for startup protected transient PingThread ping = null; @@ -955,6 +961,10 @@ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, mergedVMArguments); } } + if (version != null && version_num >= 9) { + mergedVMArguments = mergeArguments(mergedVMArguments, ALLOW_REFLECTION_ARGS, null, false); + workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, mergedVMArguments); + } } }