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 2024/10/10 19:59:45 UTC
(tomcat) branch main updated (c46c37649e -> 43018b86cc)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
from c46c37649e Fix test
new 0b84147c37 Update minimum Java version to 21
new dac8def47d Update Jasper to compile to Java 21 by default
new 9c6304ad78 Update Javadoc references to use Java 21
new 6795092946 Remove JreCompat for Java < 21
new 2052530331 Update Derby to 10.17.1.0
new 43018b86cc Add markers so it is clearer which entries need to be removed.
The 6 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:
build.properties.default | 9 +-
build.xml | 10 +-
conf/web.xml | 4 +-
.../authenticator/SpnegoAuthenticator.java | 7 +-
java/org/apache/jasper/EmbeddedServletOptions.java | 4 +-
java/org/apache/jasper/JspC.java | 4 +-
java/org/apache/jasper/compiler/JDTCompiler.java | 14 +-
.../org/apache/tomcat/util/compat/Jre19Compat.java | 84 ------------
.../org/apache/tomcat/util/compat/Jre21Compat.java | 107 ---------------
.../org/apache/tomcat/util/compat/Jre22Compat.java | 2 +-
java/org/apache/tomcat/util/compat/JreCompat.java | 150 +--------------------
.../tomcat/util/compat/LocalStrings.properties | 2 -
.../tomcat/util/compat/LocalStrings_fr.properties | 3 -
.../tomcat/util/compat/LocalStrings_ja.properties | 3 -
java/org/apache/tomcat/util/digester/package.html | 2 +-
.../apache/tomcat/util/net/SocketProperties.java | 6 +-
.../tomcat/util/net/openssl/OpenSSLEngine.java | 2 +-
.../util/net/openssl/panama/OpenSSLEngine.java | 2 +-
.../tomcat/util/threads/VirtualThreadExecutor.java | 9 +-
modules/jdbc-pool/build.xml | 2 +-
modules/jdbc-pool/doc/jdbc-pool.xml | 4 +-
webapps/docs/changelog.xml | 19 +++
webapps/docs/config/ajp.xml | 6 +-
webapps/docs/config/cluster-sender.xml | 2 +-
webapps/docs/config/context.xml | 4 +-
webapps/docs/config/http.xml | 6 +-
webapps/docs/config/http2.xml | 2 +-
webapps/docs/config/realm.xml | 2 +-
webapps/docs/jasper-howto.xml | 4 +-
webapps/docs/jndi-datasource-examples-howto.xml | 2 +-
webapps/docs/logging.xml | 2 +-
webapps/docs/tomcat-docs.xsl | 2 +-
32 files changed, 75 insertions(+), 406 deletions(-)
delete mode 100644 java/org/apache/tomcat/util/compat/Jre19Compat.java
delete mode 100644 java/org/apache/tomcat/util/compat/Jre21Compat.java
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 03/06: Update Javadoc references to use Java 21
Posted by ma...@apache.org.
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
commit 9c6304ad789c5c4b6063d60c591f79aaf5d3c722
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 12:53:22 2024 -0600
Update Javadoc references to use Java 21
---
java/org/apache/tomcat/util/digester/package.html | 2 +-
java/org/apache/tomcat/util/net/SocketProperties.java | 6 +++---
java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java | 2 +-
java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java | 2 +-
modules/jdbc-pool/build.xml | 2 +-
modules/jdbc-pool/doc/jdbc-pool.xml | 4 ++--
webapps/docs/config/ajp.xml | 6 +++---
webapps/docs/config/cluster-sender.xml | 2 +-
webapps/docs/config/context.xml | 4 ++--
webapps/docs/config/http.xml | 6 +++---
webapps/docs/config/http2.xml | 2 +-
webapps/docs/config/realm.xml | 2 +-
webapps/docs/jndi-datasource-examples-howto.xml | 2 +-
webapps/docs/logging.xml | 2 +-
14 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/java/org/apache/tomcat/util/digester/package.html b/java/org/apache/tomcat/util/digester/package.html
index 7a66d0dbc2..d61d2d61e2 100644
--- a/java/org/apache/tomcat/util/digester/package.html
+++ b/java/org/apache/tomcat/util/digester/package.html
@@ -867,7 +867,7 @@ There are many good regex libraries available. (For example
<a href='https://jakarta.apache.org/oro/index.html'>Jakarta ORO</a>,
<a href='https://jakarta.apache.org/regexp/index.html'>Jakarta Regex</a>,
<a href='http://www.cacas.org/java/gnu/regexp/'>GNU Regex</a> and
-<a href='https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/package-summary.html'>
+<a href='https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/package-summary.html'>
Java Regex</a>)
Not only do different people have different personal tastes when it comes to
regular expression matching but these products all offer different functionality
diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java b/java/org/apache/tomcat/util/net/SocketProperties.java
index a7c193f3b7..433902f048 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -152,7 +152,7 @@ public class SocketProperties {
/**
* Performance preferences according to
- * https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
+ * https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
* All three performance attributes must be set or the JVM defaults will be
* used.
*/
@@ -160,7 +160,7 @@ public class SocketProperties {
/**
* Performance preferences according to
- * https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
+ * https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
* All three performance attributes must be set or the JVM defaults will be
* used.
*/
@@ -168,7 +168,7 @@ public class SocketProperties {
/**
* Performance preferences according to
- * https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
+ * https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)
* All three performance attributes must be set or the JVM defaults will be
* used.
*/
diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java b/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
index 890d473374..0087c0b6ea 100644
--- a/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java
@@ -146,7 +146,7 @@ public final class OpenSSLEngine extends SSLEngine implements SSLUtil.ProtocolIn
private volatile boolean destroyed;
// Use an invalid cipherSuite until the handshake is completed
- // See https://docs.oracle.com/en/java/javase/17/docs/api/java.base/javax/net/ssl/SSLEngine.html#getSession()
+ // See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/javax/net/ssl/SSLEngine.html#getSession()
private volatile String version;
private volatile String cipher;
private volatile String applicationProtocol;
diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
index a528df7676..5a349ba22a 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
@@ -131,7 +131,7 @@ public final class OpenSSLEngine extends SSLEngine implements SSLUtil.ProtocolIn
private volatile boolean destroyed;
// Use an invalid cipherSuite until the handshake is completed
- // See https://docs.oracle.com/en/java/javase/17/docs/api/java.base/javax/net/ssl/SSLEngine.html#getSession()
+ // See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/javax/net/ssl/SSLEngine.html#getSession()
private volatile String version;
private volatile String cipher;
private volatile String applicationProtocol;
diff --git a/modules/jdbc-pool/build.xml b/modules/jdbc-pool/build.xml
index 86fab9bc1e..d4524f7950 100644
--- a/modules/jdbc-pool/build.xml
+++ b/modules/jdbc-pool/build.xml
@@ -145,7 +145,7 @@
additionalparam="-breakiterator -notimestamp"
verbose="false">
<classpath refid="tomcat.jdbc.classpath"/>
- <link href="https://docs.oracle.com/en/java/javase/17/docs/api/"/>
+ <link href="https://docs.oracle.com/en/java/javase/21/docs/api/"/>
<sourcepath location="${basedir}/src/main/java"/>
</javadoc>
<!-- connection pool API file-->
diff --git a/modules/jdbc-pool/doc/jdbc-pool.xml b/modules/jdbc-pool/doc/jdbc-pool.xml
index e893d7af4f..5de19e8075 100644
--- a/modules/jdbc-pool/doc/jdbc-pool.xml
+++ b/modules/jdbc-pool/doc/jdbc-pool.xml
@@ -510,13 +510,13 @@
</attribute>
<attribute name="alternateUsernameAllowed" required="false">
<p>(boolean) By default, the jdbc-pool will ignore the
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)"><code>DataSource.getConnection(username,password)</code></a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)"><code>DataSource.getConnection(username,password)</code></a>
call, and simply return a previously pooled connection under the globally configured properties <code>username</code> and <code>password</code>, for performance reasons.
</p>
<p>
The pool can however be configured to allow use of different credentials
each time a connection is requested. To enable the functionality described in the
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)"><code>DataSource.getConnection(username,password)</code></a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)"><code>DataSource.getConnection(username,password)</code></a>
call, simply set the property <code>alternateUsernameAllowed</code>
to <code>true</code>.<br />
Should you request a connection with the credentials user1/password1 and the connection
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index 605ac3bf98..dd60a247cf 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -630,19 +630,19 @@
</attribute>
<attribute name="socket.performanceConnectionTime" required="false">
<p>(int)The first value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
<attribute name="socket.performanceLatency" required="false">
<p>(int)The second value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
<attribute name="socket.performanceBandwidth" required="false">
<p>(int)The third value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
diff --git a/webapps/docs/config/cluster-sender.xml b/webapps/docs/config/cluster-sender.xml
index 9f246bbf0a..a0d26f014d 100644
--- a/webapps/docs/config/cluster-sender.xml
+++ b/webapps/docs/config/cluster-sender.xml
@@ -142,7 +142,7 @@
<attribute name="soTrafficClass" required="false">
Sets the traffic class level for the socket, the value is between 0 and 255.
Default value is <code>int soTrafficClass = 0x04 | 0x08 | 0x010;</code>
- Different values are defined in <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setTrafficClass(int)">
+ Different values are defined in <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setTrafficClass(int)">
java.net.Socket#setTrafficClass(int)</a>.
</attribute>
<attribute name="tcpNoDelay" required="false">
diff --git a/webapps/docs/config/context.xml b/webapps/docs/config/context.xml
index 0c9b61433a..9e59e39bb9 100644
--- a/webapps/docs/config/context.xml
+++ b/webapps/docs/config/context.xml
@@ -1364,8 +1364,8 @@
two additional attributes to allow a shared data source to be used with different credentials.
When these two additional attributes are used in combination with the <code>javax.sql.DataSource</code>
type, different contexts can share a global data source with different credentials.
- Under the hood, what happens is that a call to <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/javax/sql/DataSource.html#getConnection())"><code>getConnection()</code></a>
- is simply translated to a call <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)">
+ Under the hood, what happens is that a call to <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.sql/javax/sql/DataSource.html#getConnection())"><code>getConnection()</code></a>
+ is simply translated to a call <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.sql/javax/sql/DataSource.html#getConnection(java.lang.String,java.lang.String)">
<code>getConnection(username, password)</code></a> on the global data source. This is an easy way to get code to be transparent to what schemas are being used,
yet be able to control connections (or pools) in the global configuration.
</p>
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 50cbc621d2..6088715bcb 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -792,19 +792,19 @@
</attribute>
<attribute name="socket.performanceConnectionTime" required="false">
<p>(int)The first value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
<attribute name="socket.performanceLatency" required="false">
<p>(int)The second value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
<attribute name="socket.performanceBandwidth" required="false">
<p>(int)The third value for the performance settings. See
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/Socket.html#setPerformancePreferences(int,int,int)">Socket Performance Options</a>.
All three performance attributes must be set else the JVM defaults will
be used for all three.</p>
</attribute>
diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml
index 49592bc9e1..079ad57f51 100644
--- a/webapps/docs/config/http2.xml
+++ b/webapps/docs/config/http2.xml
@@ -215,7 +215,7 @@
<strong>useAsyncIO</strong> attribute of the associated
<strong>Connector</strong> is set to <code>false</code>.</p>
<p>The HTTP/2 sendfile capability uses <a
- href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/MappedByteBuffer.html"
+ href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/MappedByteBuffer.html"
>MappedByteBuffer</a> which is known to cause file locking on Windows.</p>
</attribute>
diff --git a/webapps/docs/config/realm.xml b/webapps/docs/config/realm.xml
index 2d559008eb..2bf9bb12e2 100644
--- a/webapps/docs/config/realm.xml
+++ b/webapps/docs/config/realm.xml
@@ -470,7 +470,7 @@
connection. This attribute should be a comma-separated list of values
selected from <code>auth-conf</code>, <code>auth-int</code> and
<code>auth</code>. See <a
- href="https://docs.oracle.com/en/java/javase/17/docs/api/java.security.sasl/javax/security/sasl/Sasl.html#QOP"
+ href="https://docs.oracle.com/en/java/javase/21/docs/api/java.security.sasl/javax/security/sasl/Sasl.html#QOP"
rel="nofollow">Java documentation</a> for more details.</p>
<p>The default value is <code>auth-conf</code>.</p>
</attribute>
diff --git a/webapps/docs/jndi-datasource-examples-howto.xml b/webapps/docs/jndi-datasource-examples-howto.xml
index 024c338ead..13ff2b2ce1 100644
--- a/webapps/docs/jndi-datasource-examples-howto.xml
+++ b/webapps/docs/jndi-datasource-examples-howto.xml
@@ -72,7 +72,7 @@ the section about Automatic Application Deployment in the latter reference.
<section name="DriverManager, the service provider mechanism and memory leaks">
<p><code>java.sql.DriverManager</code> supports the
-<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/java/sql/DriverManager.html">service
+<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.sql/java/sql/DriverManager.html">service
provider</a> mechanism. This feature is that all the available JDBC drivers
that announce themselves by providing a <code>META-INF/services/java.sql.Driver</code>
file are automatically discovered, loaded and registered,
diff --git a/webapps/docs/logging.xml b/webapps/docs/logging.xml
index 2e9ec308e7..91b3a7777f 100644
--- a/webapps/docs/logging.xml
+++ b/webapps/docs/logging.xml
@@ -401,7 +401,7 @@ java.util.logging.ConsoleHandler.encoding = UTF-8]]></source>
package.
</li>
<li>Oracle Java 11 Javadoc for the
- <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.logging/java/util/logging/package-summary.html"><code>java.util.logging</code></a>
+ <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/package-summary.html"><code>java.util.logging</code></a>
package.
</li>
</ul>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 04/06: Remove JreCompat for Java < 21
Posted by ma...@apache.org.
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
commit 6795092946a5e3ce6a14d04b432dcdf909df776a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 13:09:51 2024 -0600
Remove JreCompat for Java < 21
---
.../authenticator/SpnegoAuthenticator.java | 7 +-
.../org/apache/tomcat/util/compat/Jre19Compat.java | 84 ------------
.../org/apache/tomcat/util/compat/Jre21Compat.java | 107 ---------------
.../org/apache/tomcat/util/compat/Jre22Compat.java | 2 +-
java/org/apache/tomcat/util/compat/JreCompat.java | 150 +--------------------
.../tomcat/util/compat/LocalStrings.properties | 2 -
.../tomcat/util/compat/LocalStrings_fr.properties | 3 -
.../tomcat/util/compat/LocalStrings_ja.properties | 3 -
.../tomcat/util/threads/VirtualThreadExecutor.java | 9 +-
9 files changed, 9 insertions(+), 358 deletions(-)
diff --git a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
index 9227238198..496c5c1c87 100644
--- a/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/SpnegoAuthenticator.java
@@ -36,7 +36,6 @@ import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.MessageBytes;
-import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.compat.JreVendor;
import org.ietf.jgss.GSSContext;
import org.ietf.jgss.GSSCredential;
@@ -208,13 +207,13 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
} else {
credentialLifetime = GSSCredential.DEFAULT_LIFETIME;
}
- gssContext = manager.createContext(JreCompat.getInstance().callAs(subject, () -> {
+ gssContext = manager.createContext(Subject.callAs(subject, () -> {
return manager.createCredential(null, credentialLifetime, new Oid("1.3.6.1.5.5.2"),
GSSCredential.ACCEPT_ONLY);
}));
final GSSContext gssContextFinal = gssContext;
- outToken = JreCompat.getInstance().callAs(subject, () -> {
+ outToken = Subject.callAs(subject, () -> {
return gssContextFinal.acceptSecContext(decoded, 0, decoded.length);
});
@@ -228,7 +227,7 @@ public class SpnegoAuthenticator extends AuthenticatorBase {
return false;
}
- principal = JreCompat.getInstance().callAs(subject, () -> {
+ principal = Subject.callAs(subject, () -> {
return context.getRealm().authenticate(gssContextFinal, storeDelegatedCredential);
});
} catch (GSSException e) {
diff --git a/java/org/apache/tomcat/util/compat/Jre19Compat.java b/java/org/apache/tomcat/util/compat/Jre19Compat.java
deleted file mode 100644
index 60ee0c2dc1..0000000000
--- a/java/org/apache/tomcat/util/compat/Jre19Compat.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.util.compat;
-
-import java.lang.reflect.Field;
-
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.res.StringManager;
-
-public class Jre19Compat extends JreCompat {
-
- private static final Log log = LogFactory.getLog(Jre19Compat.class);
- private static final StringManager sm = StringManager.getManager(Jre19Compat.class);
-
- private static final boolean supported;
-
- static {
- // Don't need any Java 19 specific classes (yet) so just test for one of
- // the new ones for now.
- Class<?> c1 = null;
- try {
- c1 = Class.forName("java.lang.WrongThreadException");
- } catch (ClassNotFoundException cnfe) {
- // Must be pre-Java 19
- log.debug(sm.getString("jre19Compat.javaPre19"), cnfe);
- }
-
- supported = (c1 != null);
- }
-
- static boolean isSupported() {
- return supported;
- }
-
- @Override
- public Object getExecutor(Thread thread)
- throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
-
- Object result = super.getExecutor(thread);
-
- if (result == null) {
- Object holder = null;
- Object task = null;
- try {
- Field holderField = thread.getClass().getDeclaredField("holder");
- holderField.setAccessible(true);
- holder = holderField.get(thread);
-
- Field taskField = holder.getClass().getDeclaredField("task");
- taskField.setAccessible(true);
- task = taskField.get(holder);
- } catch (NoSuchFieldException nfe) {
- return null;
- }
-
- if (task!= null && task.getClass().getCanonicalName() != null &&
- (task.getClass().getCanonicalName().equals(
- "org.apache.tomcat.util.threads.ThreadPoolExecutor.Worker") ||
- task.getClass().getCanonicalName().equals(
- "java.util.concurrent.ThreadPoolExecutor.Worker"))) {
- Field executorField = task.getClass().getDeclaredField("this$0");
- executorField.setAccessible(true);
- result = executorField.get(task);
- }
- }
-
- return result;
- }
-}
diff --git a/java/org/apache/tomcat/util/compat/Jre21Compat.java b/java/org/apache/tomcat/util/compat/Jre21Compat.java
deleted file mode 100644
index c534ea4e2d..0000000000
--- a/java/org/apache/tomcat/util/compat/Jre21Compat.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.util.compat;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionException;
-
-import javax.security.auth.Subject;
-
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.res.StringManager;
-
-public class Jre21Compat extends Jre19Compat {
-
- private static final Log log = LogFactory.getLog(Jre21Compat.class);
- private static final StringManager sm = StringManager.getManager(Jre21Compat.class);
-
- private static final Method nameMethod;
- private static final Method startMethod;
- private static final Method ofVirtualMethod;
- private static final Method callAsMethod;
-
-
- static {
- Class<?> c1 = null;
- Method m1 = null;
- Method m2 = null;
- Method m3 = null;
- Method m4 = null;
-
- try {
- c1 = Class.forName("java.lang.Thread$Builder");
- m1 = c1.getMethod("name", String.class, long.class);
- m2 = c1.getMethod("start", Runnable.class);
- m3 = Thread.class.getMethod("ofVirtual", (Class<?>[]) null);
- m4 = Subject.class.getMethod("callAs", Subject.class, Callable.class);
- } catch (ClassNotFoundException e) {
- // Must be pre-Java 21
- log.debug(sm.getString("jre21Compat.javaPre21"), e);
- } catch (ReflectiveOperationException e) {
- // Should never happen
- log.error(sm.getString("jre21Compat.unexpected"), e);
- }
- nameMethod = m1;
- startMethod = m2;
- ofVirtualMethod = m3;
- callAsMethod = m4;
- }
-
- static boolean isSupported() {
- return ofVirtualMethod != null;
- }
-
- @Override
- public Object createVirtualThreadBuilder(String name) {
- try {
- Object threadBuilder = ofVirtualMethod.invoke(null, (Object[]) null);
- nameMethod.invoke(threadBuilder, name, Long.valueOf(0));
- return threadBuilder;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- throw new UnsupportedOperationException(e);
- }
- }
-
- @Override
- public void threadBuilderStart(Object threadBuilder, Runnable command) {
- try {
- startMethod.invoke(threadBuilder, command);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- throw new UnsupportedOperationException(e);
- }
- }
-
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> T callAs(Subject subject, Callable<T> action) throws CompletionException {
- try {
- return (T) callAsMethod.invoke(null, subject, action);
- } catch (IllegalAccessException e) {
- throw new CompletionException(e);
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- if (cause instanceof CompletionException) {
- throw (CompletionException) cause;
- }
- throw new CompletionException(e);
- }
- }
-}
diff --git a/java/org/apache/tomcat/util/compat/Jre22Compat.java b/java/org/apache/tomcat/util/compat/Jre22Compat.java
index fd45c20bd6..97566f51a4 100644
--- a/java/org/apache/tomcat/util/compat/Jre22Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre22Compat.java
@@ -20,7 +20,7 @@ import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
-public class Jre22Compat extends Jre21Compat {
+public class Jre22Compat extends JreCompat {
private static final Log log = LogFactory.getLog(Jre22Compat.class);
private static final StringManager sm = StringManager.getManager(Jre22Compat.class);
diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java b/java/org/apache/tomcat/util/compat/JreCompat.java
index 8f05646535..6fe6254e04 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -16,27 +16,15 @@
*/
package org.apache.tomcat.util.compat;
-import java.lang.reflect.Field;
-import java.security.PrivilegedExceptionAction;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionException;
-
-import javax.security.auth.Subject;
-
-import org.apache.tomcat.util.res.StringManager;
-
/**
- * This is the base implementation class for JRE compatibility and provides an implementation based on Java 17.
+ * This is the base implementation class for JRE compatibility and provides an implementation based on Java 21.
* Sub-classes may extend this class and provide alternative implementations for later JRE versions
*/
public class JreCompat {
private static final JreCompat instance;
private static final boolean graalAvailable;
- private static final boolean jre19Available;
- private static final boolean jre21Available;
private static final boolean jre22Available;
- private static final StringManager sm = StringManager.getManager(JreCompat.class);
static {
boolean result = false;
@@ -50,28 +38,14 @@ public class JreCompat {
}
graalAvailable = result || System.getProperty("org.graalvm.nativeimage.imagecode") != null;
- // This is Tomcat 12.0.x with a minimum Java version of Java 17.
+ // This is Tomcat 12.0.x with a minimum Java version of Java 21.
// Look for the highest supported JVM first
if (Jre22Compat.isSupported()) {
instance = new Jre22Compat();
jre22Available = true;
- jre21Available = true;
- jre19Available = true;
- } else if (Jre21Compat.isSupported()) {
- instance = new Jre21Compat();
- jre22Available = false;
- jre21Available = true;
- jre19Available = true;
- } else if (Jre19Compat.isSupported()) {
- instance = new Jre19Compat();
- jre22Available = false;
- jre21Available = false;
- jre19Available = true;
} else {
instance = new JreCompat();
jre22Available = false;
- jre21Available = false;
- jre19Available = false;
}
}
@@ -86,127 +60,7 @@ public class JreCompat {
}
- public static boolean isJre19Available() {
- return jre19Available;
- }
-
-
- public static boolean isJre21Available() {
- return jre21Available;
- }
-
-
public static boolean isJre22Available() {
return jre22Available;
}
-
-
- // Java 17 implementations of Java 19 methods
-
- /**
- * Obtains the executor, if any, used to create the provided thread.
- *
- * @param thread The thread to examine
- *
- * @return The executor, if any, that created the provided thread
- *
- * @throws NoSuchFieldException If a field used via reflection to obtain the executor cannot be found
- * @throws SecurityException If a security exception occurs while trying to identify the executor
- * @throws IllegalArgumentException If the instance object does not match the class of the field when obtaining a
- * field value via reflection
- * @throws IllegalAccessException If a field is not accessible due to access restrictions
- */
- public Object getExecutor(Thread thread)
- throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
-
- Object result = null;
-
- // Runnable wrapped by Thread
- // "target" in Sun/Oracle JDK
- // "runnable" in IBM JDK
- // "action" in Apache Harmony
- Object target = null;
- for (String fieldName : new String[] { "target", "runnable", "action" }) {
- try {
- Field targetField = thread.getClass().getDeclaredField(fieldName);
- targetField.setAccessible(true);
- target = targetField.get(thread);
- break;
- } catch (NoSuchFieldException nfe) {
- continue;
- }
- }
-
- // "java.util.concurrent" code is in public domain,
- // so all implementations are similar including our
- // internal fork.
- if (target != null && target.getClass().getCanonicalName() != null && (target.getClass().getCanonicalName()
- .equals("org.apache.tomcat.util.threads.ThreadPoolExecutor.Worker") ||
- target.getClass().getCanonicalName().equals("java.util.concurrent.ThreadPoolExecutor.Worker"))) {
- Field executorField = target.getClass().getDeclaredField("this$0");
- executorField.setAccessible(true);
- result = executorField.get(target);
- }
-
- return result;
- }
-
-
- // Java 17 implementations of Java 21 methods
-
- /**
- * Create a thread builder for virtual threads using the given name to name the threads.
- *
- * @param name The base name for the threads
- *
- * @return The thread buidler for virtual threads
- */
- public Object createVirtualThreadBuilder(String name) {
- throw new UnsupportedOperationException(sm.getString("jreCompat.noVirtualThreads"));
- }
-
-
- /**
- * Create a thread with the given thread builder and use it to execute the given runnable.
- *
- * @param threadBuilder The thread builder to use to create a thread
- * @param command The command to run
- */
- public void threadBuilderStart(Object threadBuilder, Runnable command) {
- throw new UnsupportedOperationException(sm.getString("jreCompat.noVirtualThreads"));
- }
-
-
- /*
- * This is a slightly different usage of JreCompat.
- *
- * Subject.doAs() was deprecated in Java 18 and replaced with Subject.callAs(). As of Java 23, calling
- * Subject.doAs() will trigger an UnsupportedOperationException unless the java.security.manager system property is
- * set. To avoid Tomcat installations using Spnego authentication having to set this value, JreCompat is used to
- * call Subject.callAs() instead.
- *
- * Because Java versions 18 to 22 inclusive support both the old and the new method, the switch over can occur at
- * any Java version from 18 to 22 inclusive. Java 21 onwards was selected as it as an LTS version and that removes
- * the need to add a Jre18Compat class.
- *
- * So, the slightly longer description for this method is:
- *
- * Java 17 implementation of a method replaced between Java 18 and 22 with the replacement method being used by
- * Tomcat when running on Java 21 onwards.
- */
-
- @SuppressWarnings("removal")
- public <T> T callAs(Subject subject, Callable<T> action) throws CompletionException {
- try {
- return Subject.doAs(subject, new PrivilegedExceptionAction<T>() {
-
- @Override
- public T run() throws Exception {
- return action.call();
- }
- });
- } catch (Exception e) {
- throw new CompletionException(e);
- }
- }
}
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 40184d95ab..0df209897e 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -13,6 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-jre18Compat.javaPre18=Method not found so assuming code is running on a pre-Java 18 JVM
jre22Compat.javaPre22=Class not found so assuming code is running on a pre-Java 22 JVM
-jre22Compat.unexpected=Failed to create references to Java 22 classes and methods
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties
index 959fefa499..6051bcc9b1 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings_fr.properties
@@ -16,7 +16,4 @@
# Do not edit this file directly.
# To edit translations see: https://tomcat.apache.org/getinvolved.html#Translations
-jre18Compat.javaPre18=Le code est considéré être exécuté sur une JVM antérieure à Java 18 car la méthode n'a pas été trouvée
-
jre22Compat.javaPre22=Le code est considéré être exécuté sur une JVM antérieure à Java 22 car la classe n'a pas été trouvée
-jre22Compat.unexpected=Impossible de créer les références vers les classes et méthodes de Java 22
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties
index 8649df4bf1..4129aabc83 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings_ja.properties
@@ -16,7 +16,4 @@
# Do not edit this file directly.
# To edit translations see: https://tomcat.apache.org/getinvolved.html#Translations
-jre18Compat.javaPre18=メソッドが見つからないため、Java 18 以前の JVM で実行されていると仮定します
-
jre22Compat.javaPre22=クラスが見つからないため、コードが Java 22 以前の JVM で実行されていると仮定します
-jre22Compat.unexpected=Java 22のクラストメソッドへの参照を作成するのに失敗しました
diff --git a/java/org/apache/tomcat/util/threads/VirtualThreadExecutor.java b/java/org/apache/tomcat/util/threads/VirtualThreadExecutor.java
index 54453a9a66..8f6b4f64d6 100644
--- a/java/org/apache/tomcat/util/threads/VirtualThreadExecutor.java
+++ b/java/org/apache/tomcat/util/threads/VirtualThreadExecutor.java
@@ -23,7 +23,6 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
-import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.res.StringManager;
/**
@@ -35,12 +34,10 @@ public class VirtualThreadExecutor extends AbstractExecutorService {
private CountDownLatch shutdown = new CountDownLatch(1);
- private final JreCompat jreCompat = JreCompat.getInstance();
-
- private Object threadBuilder;
+ private Thread.Builder threadBuilder;
public VirtualThreadExecutor(String namePrefix) {
- threadBuilder = jreCompat.createVirtualThreadBuilder(namePrefix);
+ threadBuilder = Thread.ofVirtual().name(namePrefix, 0);
}
@Override
@@ -49,7 +46,7 @@ public class VirtualThreadExecutor extends AbstractExecutorService {
throw new RejectedExecutionException(
sm.getString("virtualThreadExecutor.taskRejected", command.toString(), this.toString()));
}
- jreCompat.threadBuilderStart(threadBuilder, command);
+ threadBuilder.start(command);
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 01/06: Update minimum Java version to 21
Posted by ma...@apache.org.
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
commit 0b84147c37cad9cabb298cfe6b2ce79689d342aa
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 12:48:58 2024 -0600
Update minimum Java version to 21
---
build.xml | 10 +++++-----
webapps/docs/changelog.xml | 3 +++
webapps/docs/tomcat-docs.xsl | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/build.xml b/build.xml
index 88c9ac6725..902d981f97 100644
--- a/build.xml
+++ b/build.xml
@@ -104,11 +104,11 @@
<!-- build output directory for generated reflectionless code -->
<property name="tomcat.xreflect" value="${tomcat.output}/xreflect"/>
- <!-- Jakarta EE 12 platform requires Java 17+ -->
+ <!-- Jakarta EE 12 platform requires Java 21+ -->
<!-- Keep in sync with webapps/docs/tomcat-docs.xsl -->
- <property name="compile.release" value="17"/>
- <property name="min.java.version" value="17"/>
- <property name="build.java.version" value="17"/>
+ <property name="compile.release" value="21"/>
+ <property name="min.java.version" value="21"/>
+ <property name="build.java.version" value="21"/>
<property name="release.java.version" value="22"/>
<!-- Check Java Build Version -->
@@ -2416,7 +2416,7 @@
<link href="../elapi"/>
<link href="../websocketapi"/>
<link href="../jaspicapi"/>
- <link href="https://docs.oracle.com/en/java/javase/17/docs/api/"/>
+ <link href="https://docs.oracle.com/en/java/javase/21/docs/api/"/>
<link href="https://jakarta.ee/specifications/platform/11/apidocs/"/>
<packageset dir="${tomcat.dist}/src/java/">
<include name="org/**"/>
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7fa1fab682..3210fba314 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,9 @@
This release contains all of the changes up to and including those in
Apache Tomcat 11.0.0 plus the additional changes listed below. (markt)
</scode>
+ <update>
+ The minimum Java version has been updated to Java 21. (markt)
+ </update>
</changelog>
</subsection>
<subsection name="Catalina">
diff --git a/webapps/docs/tomcat-docs.xsl b/webapps/docs/tomcat-docs.xsl
index 66aa1c1c77..e70311d2d4 100644
--- a/webapps/docs/tomcat-docs.xsl
+++ b/webapps/docs/tomcat-docs.xsl
@@ -37,7 +37,7 @@
<xsl:param name="version" select="'12.0.x'"/>
<xsl:param name="majorversion" select="'12'"/>
<xsl:param name="majorminorversion" select="'12.0'"/>
- <xsl:param name="minjavaversion" select="'17'"/>
+ <xsl:param name="minjavaversion" select="'21'"/>
<xsl:param name="buildjavaversion" select="'22'"/>
<xsl:param name="antversionrequired" select="'1.10.2'"/>
<xsl:param name="build-date" select="'MMM d yyyy'"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 06/06: Add markers so it is clearer which entries need to be removed.
Posted by ma...@apache.org.
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
commit 43018b86cca787e91814341450f9460646bd5357
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 13:58:57 2024 -0600
Add markers so it is clearer which entries need to be removed.
---
webapps/docs/changelog.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4101c6c50d..9d141f1883 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,7 @@
Remove default value (was <code>catalina</code>) for the
<code>secret</code> init parameter of the WebDAV Servlet. (remm)
</update>
+ <!-- Entries for backport and removal before 12.0.0-M1 below this line -->
<update>
<bug>69374</bug>: Properly separate between table header and body
in <code>DefaultServlet</code>'s listing. (michaelo)
@@ -159,6 +160,7 @@
<code>certificateKeystorePassword</code> attribute of a certificate.
(remm)
</update>
+ <!-- Entries for backport and removal before 12.0.0-M1 below this line -->
<fix>
Return null SSL session id on zero length byte array returned from the
SSL implementation. (remm)
@@ -188,6 +190,7 @@
<code>compilerTargetVM</code> have been updated to 21 to align with Java
21 being the minimum Java version required for Tomcat 12. (markt)
</update>
+ <!-- Entries for backport and removal before 12.0.0-M1 below this line -->
</changelog>
</subsection>
<subsection name="Other">
@@ -195,6 +198,7 @@
<update>
Update Derby to 10.17.1.0. (markt)
</update>
+ <!-- Entries for backport and removal before 12.0.0-M1 below this line -->
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) 02/06: Update Jasper to compile to Java 21 by default
Posted by Rémy Maucherat <re...@apache.org>.
On Fri, Nov 1, 2024 at 7:17 PM Mark Thomas <ma...@apache.org> wrote:
>
> On 22/10/2024 15:01, Rémy Maucherat wrote:
> > On Fri, Oct 11, 2024 at 9:47 AM Rémy Maucherat <re...@apache.org> wrote:
> >>
> >> On Thu, Oct 10, 2024 at 10:01 PM <ma...@apache.org> wrote:
> >>>
> >>> 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
> >>>
> >>> commit dac8def47dd9037e050853462612bac37b095ba8
> >>> Author: Mark Thomas <ma...@apache.org>
> >>> AuthorDate: Thu Oct 10 12:52:51 2024 -0600
> >>>
> >>> Update Jasper to compile to Java 21 by default
> >>
> >> JDT now produces a weird failure on
> >> jakarta.servlet.jsp.el.TestImportELResolver when run on Java 23 (no
> >> problem on Java 21).
> >> [junit] java.lang.ClassCastException: class
> >> org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding cannot be
> >> cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
> >> (org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding and
> >> org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in
> >> unnamed module of loader 'app')
> >
> > This works with JDT 4.30 but 4.31+ fails on Java 23+ (Java 21 works).
> > The test is a very simple JSP with a static import, so basically any
> > static import seems to cause the issue.
> > It has to be a JDT issue since the INameEnvironment.findType works
> > just fine in Jasper (up to the point of failure).
>
> Possibly this:
> https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2817
>
> I just tested the latest 4.34 integration build and the issue is fixed
> so we should be be able to pick up the fix for this JDT bug in
> December/January depending on when we tag the December releases.
Nice, problem solved !
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) 02/06: Update Jasper to compile to Java 21 by default
Posted by Mark Thomas <ma...@apache.org>.
On 22/10/2024 15:01, Rémy Maucherat wrote:
> On Fri, Oct 11, 2024 at 9:47 AM Rémy Maucherat <re...@apache.org> wrote:
>>
>> On Thu, Oct 10, 2024 at 10:01 PM <ma...@apache.org> wrote:
>>>
>>> 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
>>>
>>> commit dac8def47dd9037e050853462612bac37b095ba8
>>> Author: Mark Thomas <ma...@apache.org>
>>> AuthorDate: Thu Oct 10 12:52:51 2024 -0600
>>>
>>> Update Jasper to compile to Java 21 by default
>>
>> JDT now produces a weird failure on
>> jakarta.servlet.jsp.el.TestImportELResolver when run on Java 23 (no
>> problem on Java 21).
>> [junit] java.lang.ClassCastException: class
>> org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding cannot be
>> cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
>> (org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding and
>> org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in
>> unnamed module of loader 'app')
>
> This works with JDT 4.30 but 4.31+ fails on Java 23+ (Java 21 works).
> The test is a very simple JSP with a static import, so basically any
> static import seems to cause the issue.
> It has to be a JDT issue since the INameEnvironment.findType works
> just fine in Jasper (up to the point of failure).
Possibly this:
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2817
I just tested the latest 4.34 integration build and the issue is fixed
so we should be be able to pick up the fix for this JDT bug in
December/January depending on when we tag the December releases.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) 02/06: Update Jasper to compile to Java 21 by default
Posted by Rémy Maucherat <re...@apache.org>.
On Fri, Oct 11, 2024 at 9:47 AM Rémy Maucherat <re...@apache.org> wrote:
>
> On Thu, Oct 10, 2024 at 10:01 PM <ma...@apache.org> wrote:
> >
> > 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
> >
> > commit dac8def47dd9037e050853462612bac37b095ba8
> > Author: Mark Thomas <ma...@apache.org>
> > AuthorDate: Thu Oct 10 12:52:51 2024 -0600
> >
> > Update Jasper to compile to Java 21 by default
>
> JDT now produces a weird failure on
> jakarta.servlet.jsp.el.TestImportELResolver when run on Java 23 (no
> problem on Java 21).
> [junit] java.lang.ClassCastException: class
> org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding cannot be
> cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
> (org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding and
> org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in
> unnamed module of loader 'app')
This works with JDT 4.30 but 4.31+ fails on Java 23+ (Java 21 works).
The test is a very simple JSP with a static import, so basically any
static import seems to cause the issue.
It has to be a JDT issue since the INameEnvironment.findType works
just fine in Jasper (up to the point of failure).
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) 02/06: Update Jasper to compile to Java 21 by default
Posted by Rémy Maucherat <re...@apache.org>.
On Thu, Oct 10, 2024 at 10:01 PM <ma...@apache.org> wrote:
>
> 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
>
> commit dac8def47dd9037e050853462612bac37b095ba8
> Author: Mark Thomas <ma...@apache.org>
> AuthorDate: Thu Oct 10 12:52:51 2024 -0600
>
> Update Jasper to compile to Java 21 by default
JDT now produces a weird failure on
jakarta.servlet.jsp.el.TestImportELResolver when run on Java 23 (no
problem on Java 21).
[junit] java.lang.ClassCastException: class
org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding cannot be
cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
(org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding and
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in
unnamed module of loader 'app')
Rémy
> ---
> conf/web.xml | 4 ++--
> java/org/apache/jasper/EmbeddedServletOptions.java | 4 ++--
> java/org/apache/jasper/JspC.java | 4 ++--
> java/org/apache/jasper/compiler/JDTCompiler.java | 14 +++++++-------
> webapps/docs/changelog.xml | 5 +++++
> webapps/docs/jasper-howto.xml | 4 ++--
> 6 files changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/conf/web.xml b/conf/web.xml
> index d4037523fc..7d4637ac26 100644
> --- a/conf/web.xml
> +++ b/conf/web.xml
> @@ -160,9 +160,9 @@
> <!-- pages. See the jasper documentation for more -->
> <!-- information. -->
> <!-- -->
> - <!-- compilerSourceVM Compiler source VM. [17] -->
> + <!-- compilerSourceVM Compiler source VM. [21] -->
> <!-- -->
> - <!-- compilerTargetVM Compiler target VM. [17] -->
> + <!-- compilerTargetVM Compiler target VM. [21] -->
> <!-- -->
> <!-- development Is Jasper used in development mode? If true, -->
> <!-- the frequency at which JSPs are checked for -->
> diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java b/java/org/apache/jasper/EmbeddedServletOptions.java
> index 5bfd47eb72..6176740b32 100644
> --- a/java/org/apache/jasper/EmbeddedServletOptions.java
> +++ b/java/org/apache/jasper/EmbeddedServletOptions.java
> @@ -124,12 +124,12 @@ public final class EmbeddedServletOptions implements Options {
> /**
> * Compiler target VM.
> */
> - private String compilerTargetVM = "17";
> + private String compilerTargetVM = "21";
>
> /**
> * The compiler source VM.
> */
> - private String compilerSourceVM = "17";
> + private String compilerSourceVM = "21";
>
> /**
> * The compiler class name.
> diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
> index 8656617bef..e31918cca5 100644
> --- a/java/org/apache/jasper/JspC.java
> +++ b/java/org/apache/jasper/JspC.java
> @@ -197,8 +197,8 @@ public class JspC extends Task implements Options {
>
> protected String compiler = null;
>
> - protected String compilerTargetVM = "17";
> - protected String compilerSourceVM = "17";
> + protected String compilerTargetVM = "21";
> + protected String compilerSourceVM = "21";
>
> protected boolean classDebugInfo = true;
>
> diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
> index a9e6347665..67fa51bbde 100644
> --- a/java/org/apache/jasper/compiler/JDTCompiler.java
> +++ b/java/org/apache/jasper/compiler/JDTCompiler.java
> @@ -332,11 +332,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
> settings.put(CompilerOptions.OPTION_Source, "24");
> } else {
> log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt));
> - settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
> + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_21);
> }
> } else {
> - // Default to 17
> - settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
> + // Default to 21
> + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_21);
> }
>
> // Target JVM
> @@ -420,12 +420,12 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
> settings.put(CompilerOptions.OPTION_Compliance, "24");
> } else {
> log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt));
> - settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
> + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_21);
> }
> } else {
> - // Default to 17
> - settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
> - settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_17);
> + // Default to 21
> + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_21);
> + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_21);
> }
>
> final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
> index 3210fba314..56e902bc72 100644
> --- a/webapps/docs/changelog.xml
> +++ b/webapps/docs/changelog.xml
> @@ -183,6 +183,11 @@
> Language to support mergin <code>Map</code>Map and <code>Set</code>Set
> and concatenating <code>List</code>s. (markt)
> </add>
> + <update>
> + The defaults for <code>compilerSourceVM</code> and
> + <code>compilerTargetVM</code> have been updated to 21 to align with Java
> + 21 being the minimum Java version required for Tomcat 12. (markt)
> + </update>
> </changelog>
> </subsection>
> </section>
> diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml
> index e0d35f7911..0ef59ec158 100644
> --- a/webapps/docs/jasper-howto.xml
> +++ b/webapps/docs/jasper-howto.xml
> @@ -106,10 +106,10 @@ set then <code>setenv.[sh|bat]</code> should be used to add
> to the <code>CLASSPATH</code> environment variable.</li>
>
> <li><strong>compilerSourceVM</strong> - What JDK version are the source files
> -compatible with? (Default value: <code>17</code>)</li>
> +compatible with? (Default value: <code>21</code>)</li>
>
> <li><strong>compilerTargetVM</strong> - What JDK version are the generated files
> -compatible with? (Default value: <code>17</code>)</li>
> +compatible with? (Default value: <code>21</code>)</li>
>
> <li><strong>development</strong> - Is Jasper used in development mode? If true,
> the frequency at which JSPs are checked for modification may be specified via
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 02/06: Update Jasper to compile to Java 21 by default
Posted by ma...@apache.org.
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
commit dac8def47dd9037e050853462612bac37b095ba8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 12:52:51 2024 -0600
Update Jasper to compile to Java 21 by default
---
conf/web.xml | 4 ++--
java/org/apache/jasper/EmbeddedServletOptions.java | 4 ++--
java/org/apache/jasper/JspC.java | 4 ++--
java/org/apache/jasper/compiler/JDTCompiler.java | 14 +++++++-------
webapps/docs/changelog.xml | 5 +++++
webapps/docs/jasper-howto.xml | 4 ++--
6 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/conf/web.xml b/conf/web.xml
index d4037523fc..7d4637ac26 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -160,9 +160,9 @@
<!-- pages. See the jasper documentation for more -->
<!-- information. -->
<!-- -->
- <!-- compilerSourceVM Compiler source VM. [17] -->
+ <!-- compilerSourceVM Compiler source VM. [21] -->
<!-- -->
- <!-- compilerTargetVM Compiler target VM. [17] -->
+ <!-- compilerTargetVM Compiler target VM. [21] -->
<!-- -->
<!-- development Is Jasper used in development mode? If true, -->
<!-- the frequency at which JSPs are checked for -->
diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java b/java/org/apache/jasper/EmbeddedServletOptions.java
index 5bfd47eb72..6176740b32 100644
--- a/java/org/apache/jasper/EmbeddedServletOptions.java
+++ b/java/org/apache/jasper/EmbeddedServletOptions.java
@@ -124,12 +124,12 @@ public final class EmbeddedServletOptions implements Options {
/**
* Compiler target VM.
*/
- private String compilerTargetVM = "17";
+ private String compilerTargetVM = "21";
/**
* The compiler source VM.
*/
- private String compilerSourceVM = "17";
+ private String compilerSourceVM = "21";
/**
* The compiler class name.
diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index 8656617bef..e31918cca5 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -197,8 +197,8 @@ public class JspC extends Task implements Options {
protected String compiler = null;
- protected String compilerTargetVM = "17";
- protected String compilerSourceVM = "17";
+ protected String compilerTargetVM = "21";
+ protected String compilerSourceVM = "21";
protected boolean classDebugInfo = true;
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
index a9e6347665..67fa51bbde 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -332,11 +332,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_Source, "24");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt));
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
+ settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_21);
}
} else {
- // Default to 17
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
+ // Default to 21
+ settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_21);
}
// Target JVM
@@ -420,12 +420,12 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_Compliance, "24");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt));
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
+ settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_21);
}
} else {
- // Default to 17
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_17);
+ // Default to 21
+ settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_21);
+ settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_21);
}
final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3210fba314..56e902bc72 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -183,6 +183,11 @@
Language to support mergin <code>Map</code>Map and <code>Set</code>Set
and concatenating <code>List</code>s. (markt)
</add>
+ <update>
+ The defaults for <code>compilerSourceVM</code> and
+ <code>compilerTargetVM</code> have been updated to 21 to align with Java
+ 21 being the minimum Java version required for Tomcat 12. (markt)
+ </update>
</changelog>
</subsection>
</section>
diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml
index e0d35f7911..0ef59ec158 100644
--- a/webapps/docs/jasper-howto.xml
+++ b/webapps/docs/jasper-howto.xml
@@ -106,10 +106,10 @@ set then <code>setenv.[sh|bat]</code> should be used to add
to the <code>CLASSPATH</code> environment variable.</li>
<li><strong>compilerSourceVM</strong> - What JDK version are the source files
-compatible with? (Default value: <code>17</code>)</li>
+compatible with? (Default value: <code>21</code>)</li>
<li><strong>compilerTargetVM</strong> - What JDK version are the generated files
-compatible with? (Default value: <code>17</code>)</li>
+compatible with? (Default value: <code>21</code>)</li>
<li><strong>development</strong> - Is Jasper used in development mode? If true,
the frequency at which JSPs are checked for modification may be specified via
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 05/06: Update Derby to 10.17.1.0
Posted by ma...@apache.org.
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
commit 20525303316274ab712901f480c9711b626d4452
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 10 13:51:07 2024 -0600
Update Derby to 10.17.1.0
---
build.properties.default | 9 ++++-----
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/build.properties.default b/build.properties.default
index e053d77440..b3f2c7365a 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -318,17 +318,16 @@ jsign.jar=${jsign.home}/jsign-${jsign.version}.jar
jsign.loc=${base-maven.loc}/net/jsign/jsign/${jsign.version}/jsign-${jsign.version}.jar
# ----- Derby, used by unit tests -----
-# 10.16.1.1 is the latest version that runs on Java 17
-derby.version=10.16.1.1
+derby.version=10.17.1.0
derby.checksum.enabled=true
derby.checksum.algorithm=MD5|SHA-1
-derby.checksum.value=d9c38ece80f4ec0756f54b06716a3dd6|f9ca2054b3e33ec3f3f19df4a7490352d82de54a
+derby.checksum.value=0665c8f3365fca01eb639e41f7685991|e90e61e8ee731614a9bafd3d81155e09fff5e80c
derby-shared.checksum.enabled=true
derby-shared.checksum.algorithm=MD5|SHA-1
-derby-shared.checksum.value=e423cba3150f195debaf7ff0d307ecf6|77a3ec6b9791c7c29c76148c5d56fc1f3f12d638
+derby-shared.checksum.value=ce2d7164d5cda8ac3a1ede81023814d4|e6eac60d1b80b3781dff97ccef88fa131043f2a5
derby-tools.checksum.enabled=true
derby-tools.checksum.algorithm=MD5|SHA-1
-derby-tools.checksum.value=25b138905deb681ff167a5a04d29c3c6|32a5335f9087022cd8ca5c85f35f8c844b1360a9
+derby-tools.checksum.value=ea7b7cba09a4056219e888bcdc1a3bb7|6d1a4e5e0f5c26516abbba85ece081506b9ad2e1
derby.home=${base.path}/derby-${derby.version}
derby.jar=${derby.home}/derby-${derby.version}.jar
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 56e902bc72..4101c6c50d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -190,6 +190,13 @@
</update>
</changelog>
</subsection>
+ <subsection name="Other">
+ <changelog>
+ <update>
+ Update Derby to 10.17.1.0. (markt)
+ </update>
+ </changelog>
+ </subsection>
</section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org