(tomcat) branch main updated: jakarta.transaction cleanups

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 806420c0d7 jakarta.transaction cleanups
806420c0d7 is described below

commit 806420c0d75fd7d6dd16936e5ae8191ab6e9ad1c
Author: remm 
AuthorDate: Tue Mar 25 10:54:58 2025 +0100

jakarta.transaction cleanups
---
 java/jakarta/annotation/Priority.java| 2 +-
 java/jakarta/transaction/HeuristicCommitException.java   | 3 +++
 java/jakarta/transaction/HeuristicMixedException.java| 3 +++
 java/jakarta/transaction/HeuristicRollbackException.java | 3 +++
 java/jakarta/transaction/InvalidTransactionException.java| 3 +++
 java/jakarta/transaction/NotSupportedException.java  | 3 +++
 java/jakarta/transaction/RollbackException.java  | 3 +++
 java/jakarta/transaction/SystemException.java| 3 +++
 java/jakarta/transaction/TransactionRequiredException.java   | 3 +++
 java/jakarta/transaction/TransactionRolledbackException.java | 3 +++
 10 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/java/jakarta/annotation/Priority.java 
b/java/jakarta/annotation/Priority.java
index 8fd399c094..c44be40d7f 100644
--- a/java/jakarta/annotation/Priority.java
+++ b/java/jakarta/annotation/Priority.java
@@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
 
 /**
  * Used to define the order in which classes or parameters should be used. The 
annotated class or parameter defines how
- * the prority value is used.
+ * the priority value is used.
  *
  * @since Common Annotations 1.2
  */
diff --git a/java/jakarta/transaction/HeuristicCommitException.java 
b/java/jakarta/transaction/HeuristicCommitException.java
index 455e989c47..1c56f380d8 100644
--- a/java/jakarta/transaction/HeuristicCommitException.java
+++ b/java/jakarta/transaction/HeuristicCommitException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicCommitException extends Exception {
 
+@Serial
 private static final long serialVersionUID = -3977609782149921760L;
 
 public HeuristicCommitException() {
diff --git a/java/jakarta/transaction/HeuristicMixedException.java 
b/java/jakarta/transaction/HeuristicMixedException.java
index 7d0534445e..50b86867a3 100644
--- a/java/jakarta/transaction/HeuristicMixedException.java
+++ b/java/jakarta/transaction/HeuristicMixedException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicMixedException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 234501434968595L;
 
 public HeuristicMixedException() {
diff --git a/java/jakarta/transaction/HeuristicRollbackException.java 
b/java/jakarta/transaction/HeuristicRollbackException.java
index c7312f56d3..2ee7cc6bf5 100644
--- a/java/jakarta/transaction/HeuristicRollbackException.java
+++ b/java/jakarta/transaction/HeuristicRollbackException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicRollbackException extends Exception {
 
+@Serial
 private static final long serialVersionUID = -3483618944556408897L;
 
 public HeuristicRollbackException() {
diff --git a/java/jakarta/transaction/InvalidTransactionException.java 
b/java/jakarta/transaction/InvalidTransactionException.java
index f75b185feb..97e0476ab1 100644
--- a/java/jakarta/transaction/InvalidTransactionException.java
+++ b/java/jakarta/transaction/InvalidTransactionException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class InvalidTransactionException extends java.rmi.RemoteException {
 
+@Serial
 private static final long serialVersionUID = 3597320220337691496L;
 
 public InvalidTransactionException() {
diff --git a/java/jakarta/transaction/NotSupportedException.java 
b/java/jakarta/transaction/NotSupportedException.java
index 89ffc6329b..073ce36240 100644
--- a/java/jakarta/transaction/NotSupportedException.java
+++ b/java/jakarta/transaction/NotSupportedException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class NotSupportedException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 56870312332816390L;
 
 public NotSupportedException() {
diff --git a/java/jakarta/transaction/RollbackException.java 
b/java/jakarta/transaction/RollbackException.java
index d44cfcd12b..f0b1d0b887 100644
--- a/java/jakarta/transaction/RollbackException.java
+++ b/java/jakarta/transaction/RollbackException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class RollbackException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 4151607774785285395L;
 

(tomcat) branch 11.0.x updated: jakarta.transaction cleanups

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 97da7ae49a jakarta.transaction cleanups
97da7ae49a is described below

commit 97da7ae49aa3c321aa4cb97acb9b73b6aa4e852b
Author: remm 
AuthorDate: Tue Mar 25 10:54:58 2025 +0100

jakarta.transaction cleanups
---
 java/jakarta/annotation/Priority.java| 2 +-
 java/jakarta/transaction/HeuristicCommitException.java   | 3 +++
 java/jakarta/transaction/HeuristicMixedException.java| 3 +++
 java/jakarta/transaction/HeuristicRollbackException.java | 3 +++
 java/jakarta/transaction/InvalidTransactionException.java| 3 +++
 java/jakarta/transaction/NotSupportedException.java  | 3 +++
 java/jakarta/transaction/RollbackException.java  | 3 +++
 java/jakarta/transaction/SystemException.java| 3 +++
 java/jakarta/transaction/TransactionRequiredException.java   | 3 +++
 java/jakarta/transaction/TransactionRolledbackException.java | 3 +++
 10 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/java/jakarta/annotation/Priority.java 
b/java/jakarta/annotation/Priority.java
index 8fd399c094..c44be40d7f 100644
--- a/java/jakarta/annotation/Priority.java
+++ b/java/jakarta/annotation/Priority.java
@@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
 
 /**
  * Used to define the order in which classes or parameters should be used. The 
annotated class or parameter defines how
- * the prority value is used.
+ * the priority value is used.
  *
  * @since Common Annotations 1.2
  */
diff --git a/java/jakarta/transaction/HeuristicCommitException.java 
b/java/jakarta/transaction/HeuristicCommitException.java
index 455e989c47..1c56f380d8 100644
--- a/java/jakarta/transaction/HeuristicCommitException.java
+++ b/java/jakarta/transaction/HeuristicCommitException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicCommitException extends Exception {
 
+@Serial
 private static final long serialVersionUID = -3977609782149921760L;
 
 public HeuristicCommitException() {
diff --git a/java/jakarta/transaction/HeuristicMixedException.java 
b/java/jakarta/transaction/HeuristicMixedException.java
index 7d0534445e..50b86867a3 100644
--- a/java/jakarta/transaction/HeuristicMixedException.java
+++ b/java/jakarta/transaction/HeuristicMixedException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicMixedException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 234501434968595L;
 
 public HeuristicMixedException() {
diff --git a/java/jakarta/transaction/HeuristicRollbackException.java 
b/java/jakarta/transaction/HeuristicRollbackException.java
index c7312f56d3..2ee7cc6bf5 100644
--- a/java/jakarta/transaction/HeuristicRollbackException.java
+++ b/java/jakarta/transaction/HeuristicRollbackException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class HeuristicRollbackException extends Exception {
 
+@Serial
 private static final long serialVersionUID = -3483618944556408897L;
 
 public HeuristicRollbackException() {
diff --git a/java/jakarta/transaction/InvalidTransactionException.java 
b/java/jakarta/transaction/InvalidTransactionException.java
index f75b185feb..97e0476ab1 100644
--- a/java/jakarta/transaction/InvalidTransactionException.java
+++ b/java/jakarta/transaction/InvalidTransactionException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class InvalidTransactionException extends java.rmi.RemoteException {
 
+@Serial
 private static final long serialVersionUID = 3597320220337691496L;
 
 public InvalidTransactionException() {
diff --git a/java/jakarta/transaction/NotSupportedException.java 
b/java/jakarta/transaction/NotSupportedException.java
index 89ffc6329b..073ce36240 100644
--- a/java/jakarta/transaction/NotSupportedException.java
+++ b/java/jakarta/transaction/NotSupportedException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class NotSupportedException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 56870312332816390L;
 
 public NotSupportedException() {
diff --git a/java/jakarta/transaction/RollbackException.java 
b/java/jakarta/transaction/RollbackException.java
index d44cfcd12b..f0b1d0b887 100644
--- a/java/jakarta/transaction/RollbackException.java
+++ b/java/jakarta/transaction/RollbackException.java
@@ -16,8 +16,11 @@
  */
 package jakarta.transaction;
 
+import java.io.Serial;
+
 public class RollbackException extends Exception {
 
+@Serial
 private static final long serialVersionUID = 4151607774785285395L

[Bug 69623] regression between 9.0.27 and 9.0.29: UnknownServiceException: no content-type

2025-03-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69623

--- Comment #9 from Remy Maucherat  ---
(In reply to Mark Thomas from comment #8)
> You can ignore my previous question. I've done some further work on this and
> I see this error now.
> 
> The root cause is this commit:
> https://github.com/apache/tomcat/commit/
> 03e7bc8487cb706adf1f56586948a7762dd42d14
> 
> I'm surprised it has taken over 5 years for this regression to be reported.
> But now it has, I'll see what I can do to fix it.

I think everyone uses getResourceAsStream instead. The only ones who don't used
it to do something like getClassLoader().getResource(directoryPath), then
toString() + myFile. It's harder to get it to work, it took a while ...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [PR] Expanding Parallel Deployment section of Tomcat Docs [tomcat]

2025-03-25 Thread via GitHub


usmazat commented on PR #832:
URL: https://github.com/apache/tomcat/pull/832#issuecomment-2753348292

   > I like the idea. I don't think we have a list of ServletContext attributes 
in a single place. The implementation needs a few tweaks to fit in with how we 
build the Tomcat docs. I'll re-work this using systemprops.xml as a basis.
   > 
   > Also, the list needs to be limited to ServletContext attributes. Other 
values - such as system properties - are documented elsewhere.
   Thanks @markt-asf , please let me know if there is anything  I need to do on 
my part


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Expanding Parallel Deployment section of Tomcat Docs [tomcat]

2025-03-25 Thread via GitHub


markt-asf commented on PR #832:
URL: https://github.com/apache/tomcat/pull/832#issuecomment-2752080674

   I like the idea. I don't think we have a list of ServletContext attributes 
in a single place. The implementation needs a few tweaks to fit in with how we 
build the Tomcat docs. I'll re-work this using systemprops.xml as a basis.
   
   Also, the list needs to be limited to ServletContext attributes. Other 
values - such as system properties - are documented elsewhere.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(tomcat) branch 11.0.x updated: Cleanups

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 93f45edecc Cleanups
93f45edecc is described below

commit 93f45edecca277eaf00c5fa49f02750a525c2cc1
Author: remm 
AuthorDate: Tue Mar 25 15:41:52 2025 +0100

Cleanups
---
 .../apache/catalina/ant/BaseRedirectorHelperTask.java   |  8 
 .../apache/catalina/ant/jmx/JMXAccessorCreateTask.java  |  8 
 .../apache/catalina/ant/jmx/JMXAccessorInvokeTask.java  |  2 +-
 .../apache/catalina/ant/jmx/JMXAccessorQueryTask.java   |  3 +--
 .../org/apache/catalina/ant/jmx/JMXAccessorSetTask.java |  4 ++--
 .../catalina/ant/jmx/JMXAccessorUnregisterTask.java |  3 +--
 .../apache/catalina/authenticator/SSLAuthenticator.java |  4 ++--
 .../jaspic/PersistentProviderRegistrations.java |  2 +-
 .../apache/catalina/connector/ClientAbortException.java |  3 +++
 java/org/apache/catalina/connector/OutputBuffer.java|  4 ++--
 java/org/apache/catalina/connector/Request.java |  8 
 java/org/apache/catalina/core/StandardContext.java  | 10 +-
 java/org/apache/catalina/core/StandardHost.java |  2 +-
 java/org/apache/catalina/core/StandardWrapper.java  |  2 +-
 java/org/apache/catalina/filters/Constants.java |  2 +-
 java/org/apache/catalina/filters/CorsFilter.java| 11 +--
 .../apache/catalina/ha/deploy/FileMessageFactory.java   |  2 +-
 .../apache/catalina/loader/WebappClassLoaderBase.java   |  2 +-
 java/org/apache/catalina/manager/JspHelper.java |  6 +++---
 java/org/apache/catalina/mapper/Mapper.java |  4 ++--
 java/org/apache/catalina/mapper/WrapperMappingInfo.java |  2 +-
 java/org/apache/catalina/mbeans/ServiceMBean.java   |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java   | 16 
 java/org/apache/catalina/realm/RealmBase.java   |  2 +-
 java/org/apache/catalina/realm/UserDatabaseRealm.java   |  2 +-
 java/org/apache/catalina/servlets/CGIServlet.java   |  2 +-
 java/org/apache/catalina/servlets/WebdavServlet.java| 17 ++---
 java/org/apache/catalina/session/StoreBase.java |  4 ++--
 java/org/apache/catalina/ssi/ExpressionParseTree.java   |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  8 
 java/org/apache/catalina/startup/EngineRuleSet.java |  2 +-
 java/org/apache/catalina/util/TimeBucketCounter.java|  2 +-
 32 files changed, 69 insertions(+), 82 deletions(-)

diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java 
b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 0316faad45..b8680ae924 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -30,7 +30,7 @@ import org.apache.tools.ant.types.RedirectorElement;
 /**
  * Abstract base class to add output redirection support for Catalina Ant 
tasks. These tasks require Ant 1.5 or later.
  * 
- * WARNING: due to depends chain, Ant could call a Task more 
than once and this can affect the output
+ * WARNING: due to dependency chain, Ant could call a Task 
more than once and this can affect the output
  * redirection when configured. If you are collecting the output in a 
property, it will collect the output of only the
  * first run, since Ant properties are immutable and once created they cannot 
be changed. 
  * If you are collecting output in a file the file will be overwritten with 
the output of the last run, unless you set
@@ -63,7 +63,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
 /**
  * Whether to fail (with a BuildException) if ManagerServlet returns an 
error. The default behavior is to do so. 
  * This flag does not control parameters checking. If the task is called 
with wrong or invalid parameters, it will
- * throw BuildException independently from the setting of this flag. 
+ * throw a BuildException regardless of the setting of this flag. 
  */
 protected boolean failOnError = true;
 
@@ -218,7 +218,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 redirectOutput = true;
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to configure
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attempt to configure
  * uselessly more than once the Redirector.
  */
 redirectorConfigured = true;
@@ -256,7 +256,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 log("Error closing redirector: " + ioe.getMessage(), 
Project.MSG_ERR);
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prev

(tomcat) branch 11.0.x updated: Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

2025-03-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 4ee760a259 Fix BZ 69623 - regression in 
ClassLoader.getResource().getContent()
4ee760a259 is described below

commit 4ee760a2591239a8658f50ff0b70ce07727c3f47
Author: Mark Thomas 
AuthorDate: Tue Mar 25 14:54:20 2025 +

Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

https://bz.apache.org/bugzilla/show_bug.cgi?id=69623
---
 java/org/apache/catalina/webresources/CachedResource.java | 7 +++
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 13 insertions(+)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index 68f6b4c5c6..75cbab21b2 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -32,6 +32,7 @@ import java.security.cert.Certificate;
 import java.text.Collator;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -592,6 +593,12 @@ public class CachedResource implements WebResource {
 private WebResource getResource() {
 return root.getResource(webAppPath, false, 
usesClassLoaderResources);
 }
+
+@Override
+public String getContentType() {
+// "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
+return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+}
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5c6ba883dc..de0a9ca6fc 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -147,6 +147,12 @@
 processing the request as if the GET method had been used is unchanged.
 (markt)
   
+  
+69623: Correct a long standing regression that meant that
+calls to ClassLoader.getResource().getContent() failed 
when
+made from within a web application with resource caching enabled.
+(markt)
+  
 
   
   


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



(tomcat) branch 10.1.x updated: Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

2025-03-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 84608e1190 Fix BZ 69623 - regression in 
ClassLoader.getResource().getContent()
84608e1190 is described below

commit 84608e11906b4d56e74a3ea2f5a4df0b9e8ee09a
Author: Mark Thomas 
AuthorDate: Tue Mar 25 14:54:20 2025 +

Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

https://bz.apache.org/bugzilla/show_bug.cgi?id=69623
---
 java/org/apache/catalina/webresources/CachedResource.java | 7 +++
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 13 insertions(+)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index f42c1bfa7b..43421287c0 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -32,6 +32,7 @@ import java.security.cert.Certificate;
 import java.text.Collator;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -591,6 +592,12 @@ public class CachedResource implements WebResource {
 private WebResource getResource() {
 return root.getResource(webAppPath, false, 
usesClassLoaderResources);
 }
+
+@Override
+public String getContentType() {
+// "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
+return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+}
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a43461cd61..5207c87005 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,6 +141,12 @@
 processing the request as if the GET method had been used is unchanged.
 (markt)
   
+  
+69623: Correct a long standing regression that meant that
+calls to ClassLoader.getResource().getContent() failed 
when
+made from within a web application with resource caching enabled.
+(markt)
+  
 
   
   


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



(tomcat) branch main updated: Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

2025-03-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 6cffe2ac39 Fix BZ 69623 - regression in 
ClassLoader.getResource().getContent()
6cffe2ac39 is described below

commit 6cffe2ac39f26304cb4a4c6be1232ccb4cb20d22
Author: Mark Thomas 
AuthorDate: Tue Mar 25 14:54:20 2025 +

Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

https://bz.apache.org/bugzilla/show_bug.cgi?id=69623
---
 java/org/apache/catalina/webresources/CachedResource.java | 7 +++
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 13 insertions(+)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index 68f6b4c5c6..75cbab21b2 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -32,6 +32,7 @@ import java.security.cert.Certificate;
 import java.text.Collator;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -592,6 +593,12 @@ public class CachedResource implements WebResource {
 private WebResource getResource() {
 return root.getResource(webAppPath, false, 
usesClassLoaderResources);
 }
+
+@Override
+public String getContentType() {
+// "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
+return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+}
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 37fa07bd45..25f6f8c3be 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -191,6 +191,12 @@
 processing the request as if the GET method had been used is unchanged.
 (markt)
   
+  
+69623: Correct a long standing regression that meant that
+calls to ClassLoader.getResource().getContent() failed 
when
+made from within a web application with resource caching enabled.
+(markt)
+  
 
   
   


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



(tomcat) branch 9.0.x updated: Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

2025-03-25 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 07266dae64 Fix BZ 69623 - regression in 
ClassLoader.getResource().getContent()
07266dae64 is described below

commit 07266dae646872de41f59260ff38d05b972de8d1
Author: Mark Thomas 
AuthorDate: Tue Mar 25 14:54:20 2025 +

Fix BZ 69623 - regression in ClassLoader.getResource().getContent()

https://bz.apache.org/bugzilla/show_bug.cgi?id=69623
---
 java/org/apache/catalina/webresources/CachedResource.java | 7 +++
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 13 insertions(+)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index f42c1bfa7b..43421287c0 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -32,6 +32,7 @@ import java.security.cert.Certificate;
 import java.text.Collator;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -591,6 +592,12 @@ public class CachedResource implements WebResource {
 private WebResource getResource() {
 return root.getResource(webAppPath, false, 
usesClassLoaderResources);
 }
+
+@Override
+public String getContentType() {
+// "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
+return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+}
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index dba99bd9b9..42b62ae83d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,6 +141,12 @@
 processing the request as if the GET method had been used is unchanged.
 (markt)
   
+  
+69623: Correct a long standing regression that meant that
+calls to ClassLoader.getResource().getContent() failed 
when
+made from within a web application with resource caching enabled.
+(markt)
+  
 
   
   


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



(tomcat) branch 10.1.x updated: Cleanup

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new d170bd72b7 Cleanup
d170bd72b7 is described below

commit d170bd72b732e56fa6c4a3c7dfe5d9dae2665b2c
Author: remm 
AuthorDate: Tue Mar 25 15:41:52 2025 +0100

Cleanup
---
 .../apache/catalina/ant/BaseRedirectorHelperTask.java   |  8 
 .../apache/catalina/ant/jmx/JMXAccessorCreateTask.java  |  8 
 .../apache/catalina/ant/jmx/JMXAccessorInvokeTask.java  |  2 +-
 .../apache/catalina/ant/jmx/JMXAccessorQueryTask.java   |  3 +--
 .../org/apache/catalina/ant/jmx/JMXAccessorSetTask.java |  4 ++--
 .../catalina/ant/jmx/JMXAccessorUnregisterTask.java |  3 +--
 .../apache/catalina/authenticator/SSLAuthenticator.java |  4 ++--
 .../jaspic/PersistentProviderRegistrations.java |  2 +-
 java/org/apache/catalina/connector/OutputBuffer.java|  2 +-
 java/org/apache/catalina/connector/Request.java |  8 
 java/org/apache/catalina/core/StandardContext.java  | 10 +-
 java/org/apache/catalina/core/StandardHost.java |  2 +-
 java/org/apache/catalina/core/StandardWrapper.java  |  2 +-
 java/org/apache/catalina/filters/Constants.java |  2 +-
 java/org/apache/catalina/filters/CorsFilter.java|  2 +-
 .../apache/catalina/ha/deploy/FileMessageFactory.java   |  2 +-
 .../apache/catalina/loader/WebappClassLoaderBase.java   |  2 +-
 java/org/apache/catalina/manager/JspHelper.java |  6 +++---
 java/org/apache/catalina/mapper/Mapper.java |  4 ++--
 java/org/apache/catalina/mbeans/ServiceMBean.java   |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java   | 16 
 java/org/apache/catalina/realm/RealmBase.java   |  2 +-
 java/org/apache/catalina/realm/UserDatabaseRealm.java   |  2 +-
 java/org/apache/catalina/servlets/CGIServlet.java   |  2 +-
 java/org/apache/catalina/servlets/WebdavServlet.java| 17 ++---
 java/org/apache/catalina/session/StoreBase.java |  4 ++--
 java/org/apache/catalina/ssi/ExpressionParseTree.java   |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  8 
 java/org/apache/catalina/startup/EngineRuleSet.java |  2 +-
 java/org/apache/catalina/util/TimeBucketCounter.java|  2 +-
 30 files changed, 60 insertions(+), 75 deletions(-)

diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java 
b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 0316faad45..b8680ae924 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -30,7 +30,7 @@ import org.apache.tools.ant.types.RedirectorElement;
 /**
  * Abstract base class to add output redirection support for Catalina Ant 
tasks. These tasks require Ant 1.5 or later.
  * 
- * WARNING: due to depends chain, Ant could call a Task more 
than once and this can affect the output
+ * WARNING: due to dependency chain, Ant could call a Task 
more than once and this can affect the output
  * redirection when configured. If you are collecting the output in a 
property, it will collect the output of only the
  * first run, since Ant properties are immutable and once created they cannot 
be changed. 
  * If you are collecting output in a file the file will be overwritten with 
the output of the last run, unless you set
@@ -63,7 +63,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
 /**
  * Whether to fail (with a BuildException) if ManagerServlet returns an 
error. The default behavior is to do so. 
  * This flag does not control parameters checking. If the task is called 
with wrong or invalid parameters, it will
- * throw BuildException independently from the setting of this flag. 
+ * throw a BuildException regardless of the setting of this flag. 
  */
 protected boolean failOnError = true;
 
@@ -218,7 +218,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 redirectOutput = true;
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to configure
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attempt to configure
  * uselessly more than once the Redirector.
  */
 redirectorConfigured = true;
@@ -256,7 +256,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 log("Error closing redirector: " + ioe.getMessage(), 
Project.MSG_ERR);
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to reuse the
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attemp

(tomcat) branch 9.0.x updated: Cleanups

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new ca09984922 Cleanups
ca09984922 is described below

commit ca09984922cabb8c6de6a23eadd87d0a285d384c
Author: remm 
AuthorDate: Tue Mar 25 15:41:52 2025 +0100

Cleanups
---
 .../apache/catalina/ant/BaseRedirectorHelperTask.java   |  8 
 .../apache/catalina/ant/jmx/JMXAccessorCreateTask.java  |  8 
 .../apache/catalina/ant/jmx/JMXAccessorInvokeTask.java  |  2 +-
 .../apache/catalina/ant/jmx/JMXAccessorQueryTask.java   |  3 +--
 .../org/apache/catalina/ant/jmx/JMXAccessorSetTask.java |  4 ++--
 .../catalina/ant/jmx/JMXAccessorUnregisterTask.java |  3 +--
 .../apache/catalina/authenticator/SSLAuthenticator.java |  4 ++--
 .../jaspic/PersistentProviderRegistrations.java |  2 +-
 java/org/apache/catalina/connector/OutputBuffer.java|  2 +-
 java/org/apache/catalina/connector/Request.java |  8 
 java/org/apache/catalina/core/StandardContext.java  | 10 +-
 java/org/apache/catalina/core/StandardHost.java |  2 +-
 java/org/apache/catalina/core/StandardWrapper.java  |  2 +-
 java/org/apache/catalina/filters/Constants.java |  2 +-
 java/org/apache/catalina/filters/CorsFilter.java|  2 +-
 .../apache/catalina/ha/deploy/FileMessageFactory.java   |  2 +-
 .../apache/catalina/loader/WebappClassLoaderBase.java   |  2 +-
 java/org/apache/catalina/manager/JspHelper.java |  6 +++---
 java/org/apache/catalina/mapper/Mapper.java |  4 ++--
 java/org/apache/catalina/mbeans/ServiceMBean.java   |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java   | 16 
 java/org/apache/catalina/realm/RealmBase.java   |  2 +-
 java/org/apache/catalina/realm/UserDatabaseRealm.java   |  2 +-
 java/org/apache/catalina/servlets/CGIServlet.java   |  2 +-
 java/org/apache/catalina/servlets/WebdavServlet.java| 17 ++---
 java/org/apache/catalina/session/StoreBase.java |  4 ++--
 java/org/apache/catalina/ssi/ExpressionParseTree.java   |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  8 
 java/org/apache/catalina/startup/EngineRuleSet.java |  2 +-
 java/org/apache/catalina/util/TimeBucketCounter.java|  2 +-
 30 files changed, 60 insertions(+), 75 deletions(-)

diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java 
b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 0316faad45..b8680ae924 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -30,7 +30,7 @@ import org.apache.tools.ant.types.RedirectorElement;
 /**
  * Abstract base class to add output redirection support for Catalina Ant 
tasks. These tasks require Ant 1.5 or later.
  * 
- * WARNING: due to depends chain, Ant could call a Task more 
than once and this can affect the output
+ * WARNING: due to dependency chain, Ant could call a Task 
more than once and this can affect the output
  * redirection when configured. If you are collecting the output in a 
property, it will collect the output of only the
  * first run, since Ant properties are immutable and once created they cannot 
be changed. 
  * If you are collecting output in a file the file will be overwritten with 
the output of the last run, unless you set
@@ -63,7 +63,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
 /**
  * Whether to fail (with a BuildException) if ManagerServlet returns an 
error. The default behavior is to do so. 
  * This flag does not control parameters checking. If the task is called 
with wrong or invalid parameters, it will
- * throw BuildException independently from the setting of this flag. 
+ * throw a BuildException regardless of the setting of this flag. 
  */
 protected boolean failOnError = true;
 
@@ -218,7 +218,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 redirectOutput = true;
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to configure
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attempt to configure
  * uselessly more than once the Redirector.
  */
 redirectorConfigured = true;
@@ -256,7 +256,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 log("Error closing redirector: " + ioe.getMessage(), 
Project.MSG_ERR);
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to reuse the
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attemp

(tomcat) branch main updated: Cleanups

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new ea8a02a5e9 Cleanups
ea8a02a5e9 is described below

commit ea8a02a5e96f44250e93ce2d7d932132bf7f6e1a
Author: remm 
AuthorDate: Tue Mar 25 15:41:52 2025 +0100

Cleanups
---
 .../apache/catalina/ant/BaseRedirectorHelperTask.java   |  8 
 .../apache/catalina/ant/jmx/JMXAccessorCreateTask.java  |  8 
 .../apache/catalina/ant/jmx/JMXAccessorInvokeTask.java  |  2 +-
 .../apache/catalina/ant/jmx/JMXAccessorQueryTask.java   |  3 +--
 .../org/apache/catalina/ant/jmx/JMXAccessorSetTask.java |  4 ++--
 .../catalina/ant/jmx/JMXAccessorUnregisterTask.java |  3 +--
 .../apache/catalina/authenticator/SSLAuthenticator.java |  4 ++--
 .../jaspic/PersistentProviderRegistrations.java |  2 +-
 .../apache/catalina/connector/ClientAbortException.java |  3 +++
 java/org/apache/catalina/connector/OutputBuffer.java|  4 ++--
 java/org/apache/catalina/connector/Request.java |  8 
 java/org/apache/catalina/core/StandardContext.java  | 10 +-
 java/org/apache/catalina/core/StandardHost.java |  2 +-
 java/org/apache/catalina/core/StandardWrapper.java  |  2 +-
 java/org/apache/catalina/filters/Constants.java |  2 +-
 java/org/apache/catalina/filters/CorsFilter.java| 11 +--
 .../apache/catalina/ha/deploy/FileMessageFactory.java   |  2 +-
 .../apache/catalina/loader/WebappClassLoaderBase.java   |  2 +-
 java/org/apache/catalina/manager/JspHelper.java |  6 +++---
 java/org/apache/catalina/mapper/Mapper.java |  4 ++--
 java/org/apache/catalina/mapper/WrapperMappingInfo.java |  2 +-
 java/org/apache/catalina/mbeans/ServiceMBean.java   |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java   | 16 
 java/org/apache/catalina/realm/RealmBase.java   |  2 +-
 java/org/apache/catalina/realm/UserDatabaseRealm.java   |  2 +-
 java/org/apache/catalina/servlets/CGIServlet.java   |  2 +-
 java/org/apache/catalina/servlets/WebdavServlet.java| 17 ++---
 java/org/apache/catalina/session/StoreBase.java |  4 ++--
 java/org/apache/catalina/ssi/ExpressionParseTree.java   |  2 +-
 java/org/apache/catalina/startup/ContextConfig.java |  8 
 java/org/apache/catalina/startup/EngineRuleSet.java |  2 +-
 java/org/apache/catalina/util/TimeBucketCounter.java|  2 +-
 32 files changed, 69 insertions(+), 82 deletions(-)

diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java 
b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 0316faad45..b8680ae924 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -30,7 +30,7 @@ import org.apache.tools.ant.types.RedirectorElement;
 /**
  * Abstract base class to add output redirection support for Catalina Ant 
tasks. These tasks require Ant 1.5 or later.
  * 
- * WARNING: due to depends chain, Ant could call a Task more 
than once and this can affect the output
+ * WARNING: due to dependency chain, Ant could call a Task 
more than once and this can affect the output
  * redirection when configured. If you are collecting the output in a 
property, it will collect the output of only the
  * first run, since Ant properties are immutable and once created they cannot 
be changed. 
  * If you are collecting output in a file the file will be overwritten with 
the output of the last run, unless you set
@@ -63,7 +63,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
 /**
  * Whether to fail (with a BuildException) if ManagerServlet returns an 
error. The default behavior is to do so. 
  * This flag does not control parameters checking. If the task is called 
with wrong or invalid parameters, it will
- * throw BuildException independently from the setting of this flag. 
+ * throw a BuildException regardless of the setting of this flag. 
  */
 protected boolean failOnError = true;
 
@@ -218,7 +218,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 redirectOutput = true;
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent that we attempt to configure
+ * Due to dependency chain, Ant could call the Task more than once, 
this is to prevent that we attempt to configure
  * uselessly more than once the Redirector.
  */
 redirectorConfigured = true;
@@ -256,7 +256,7 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
 log("Error closing redirector: " + ioe.getMessage(), 
Project.MSG_ERR);
 }
 /*
- * Due to depends chain, Ant could call the Task more than once, this 
is to prevent 

[Bug 69623] regression between 9.0.27 and 9.0.29: UnknownServiceException: no content-type

2025-03-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69623

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #10 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.6 onwards
- 10.1.x for 10.1.40 onwards
-  9.0.x for  9.0.103 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 9.0.x updated: Java 8 fix

2025-03-25 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new a9f06927e0 Java 8 fix
a9f06927e0 is described below

commit a9f06927e08f1ba3e7a0e0c1141473080044ac4a
Author: remm 
AuthorDate: Tue Mar 25 16:08:46 2025 +0100

Java 8 fix
---
 java/org/apache/catalina/webresources/CachedResource.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index 43421287c0..72bd60e967 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -32,7 +32,6 @@ import java.security.cert.Certificate;
 import java.text.Collator;
 import java.util.Arrays;
 import java.util.Locale;
-import java.util.Objects;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -596,7 +595,7 @@ public class CachedResource implements WebResource {
 @Override
 public String getContentType() {
 // "content/unknown" is the value used by 
sun.net.www.URLConnection. It is used here for consistency.
-return Objects.requireNonNullElse(getResource().getMimeType(), 
"content/unknown");
+return (getResource().getMimeType() != null) ? 
getResource().getMimeType() : "content/unknown";
 }
 }
 


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



[Bug 69623] regression between 9.0.27 and 9.0.29: UnknownServiceException: no content-type

2025-03-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69623

--- Comment #8 from Mark Thomas  ---
You can ignore my previous question. I've done some further work on this and I
see this error now.

The root cause is this commit:
https://github.com/apache/tomcat/commit/03e7bc8487cb706adf1f56586948a7762dd42d14

I'm surprised it has taken over 5 years for this regression to be reported. But
now it has, I'll see what I can do to fix it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org