[Bug 66567] New: java.lang.IllegalArgumentException: URI is not absolute - Feature change or Regression ?

2023-04-17 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66567

Bug ID: 66567
   Summary: java.lang.IllegalArgumentException: URI is not
absolute - Feature change or Regression ?
   Product: Tomcat 9
   Version: 9.0.73
  Hardware: All
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: electric.blue.jag...@gmail.com
  Target Milestone: -

Given a web.xml containing the following:

/WEB-INF/wsdl/SomeRequestDelegator.wsdl


This works fine in previous versions of Tomcat through at least 9.0.68.  
Something changed between 9.0.68 and 9.0.72/9.0.73

In 9.0.73 this now yields at application startup:

Caused by: org.apache.catalina.LifecycleException: Failed to start
component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SOMEapp]]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
... 37 more
Caused by: java.lang.IllegalArgumentException: URI is not absolute
at java.base/java.net.URL.fromURI(Unknown Source)
at java.base/java.net.URI.toURL(Unknown Source)
at
org.apache.catalina.core.NamingContextListener.addService(NamingContextListener.java:833)
at
org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:566)
at
org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:243)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4851)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more


Relevant code in NamingContextListener in 9.0.73:

public void addService(ContextService service) {

Reference ref = lookForLookupRef(service);

if (ref == null) {

if (service.getWsdlfile() != null) {
URL wsdlURL = null;

try {
URI wsdlURI = new URI(service.getWsdlfile());
wsdlURL = wsdlURI.toURL();   <-- line 833
} catch (MalformedURLException | URISyntaxException e) {
// Ignore and carry on
}


I can't tell if there has been a feature change to tighten up adherence to an
RFC specification or if this is a regression.

This works fine on OpenJDK 11.0.18 Temurin with Tomcat 9.0.68 but fails with
Tomcat 9.0.72 and 9.0.73.

-- 
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: [VOTE] Release Apache Tomcat 8.5.88

2023-04-17 Thread Christopher Schultz

Mark,

On 4/17/23 05:07, Mark Thomas wrote:

On 16/04/2023 18:59, Mark Thomas wrote:

On 14/04/2023 21:38, Christopher Schultz wrote:


The proposed 8.5.88 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 8.5.88 (stable)


Build is reproducible on Windows x64 but not Linux x64.

Unit tests pass on Linux x64, Windows x64, MacOS M1 and MacOS x64.

It appears the compiler constructs a slightly different class for 
NioEndpoint$Poller when compiling on Linux x64. I started to dig into 
why but didn't reach a conclusion. Investigating further is on my TODO 
list.


I have made some progress. The difference is in how the following line 
is handled (there are other differences but this is the first and the 
other differences may be as a result of this one).


https://github.com/apache/tomcat/blob/8.5.x/java/org/apache/tomcat/util/net/NioEndpoint.java#L846

When compiling on Windows with Java 11 targeting Java 7 the following 
byte code is generated:


...
126:  aload    %4
128:  invokevirtual
org.apache.tomcat.util.net.NioChannel.getIOChannel 
()Ljava/nio/channels/SocketChannel; (32)

131:  checkcast     (121)
134:  astore    %6
...

When compiling on Linux with Java 11 targeting Java 7 the checkcast 
command is not present. Neither is it present when compiling on Windows 
with Java 11 targeting Java 8.


This is arguably a bug in the compiler - the byte code should be the 
same across platforms - but having researched things this far, I don't 
plan to pursue this further.


+1 to ignoring this, though it is annoying that the build is therefore 
not completely reproducible.


Do you have an account with the Eclipse bug-tracker used for JDK bugs? I 
don't think I do. Is this something you can report? It should be 
trivially reproducible (hah!) with publicly-available artifacts.


Thanks,
-chris

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



[GitHub] [tomcat-jakartaee-migration] markt-asf commented on pull request #42: Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

2023-04-17 Thread via GitHub


markt-asf commented on PR #42:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/42#issuecomment-1512004122

   Please open a new issue to discuss options.


-- 
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-jakartaee-migration] branch main updated: Update dependencies

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new 2b78627  Update dependencies
2b78627 is described below

commit 2b78627f133d5b813a13338ce7144a1f21a97e5b
Author: Mark Thomas 
AuthorDate: Mon Apr 17 21:00:48 2023 +0100

Update dependencies
---
 CHANGES.md | 6 --
 pom.xml| 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 3af0e99..719a9c9 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,8 +3,10 @@
 ## 1.0.7
 
 - When converting directories, rename files according to the chosen profile. 
(fschumacher)
-- Add configuration option, `matchExcludesAgainstPathName` that can be used to 
configure exclusions base don path name rather than just file name.  
PR[#38](https://github.com/apache/tomcat-jakartaee-migration/pull/38) provided 
by Réda Housni Alaoui (markt)
-- Update OSGI servlet specification versions if present in manifest file. 
PR[#42](https://github.com/apache/tomcat-jakartaee-migration/pull/42) provided 
by Ivan Furnadjiev (markt)
+- Add configuration option, `matchExcludesAgainstPathName` that can be used to 
configure exclusions base don path name rather than just file name.  
PR[#38](https://github.com/apache/tomcat-jakartaee-migration/pull/38) provided 
by Réda Housni Alaoui. (markt)
+- Update OSGI servlet specification versions if present in manifest file. 
PR[#42](https://github.com/apache/tomcat-jakartaee-migration/pull/42) provided 
by Ivan Furnadjiev. (markt)
+- Update Commons BCEL to 6.7.0. (markt)
+- Update Commons Compress to 1.23.0. (markt)
 
 
 ## 1.0.6
diff --git a/pom.xml b/pom.xml
index df48118..69d2e4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,12 +77,12 @@
 
   org.apache.bcel
   bcel
-  6.6.0
+  6.7.0
 
 
   org.apache.commons
   commons-compress
-  1.22
+  1.23.0
 
 
   commons-io


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



[GitHub] [tomcat-jakartaee-migration] ebourg commented on pull request #42: Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

2023-04-17 Thread via GitHub


ebourg commented on PR #42:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/42#issuecomment-1511994026

   Changing the range to an arbitrary value is a bit odd. What about dropping 
the range completely?


-- 
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-jakartaee-migration] branch main updated: Add matchExcludesAgainstPathName support to CLI

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new 4056f47  Add matchExcludesAgainstPathName support to CLI
4056f47 is described below

commit 4056f47572944e8b2d5be405b6b5f69c36291916
Author: Mark Thomas 
AuthorDate: Mon Apr 17 20:42:18 2023 +0100

Add matchExcludesAgainstPathName support to CLI
---
 src/main/java/org/apache/tomcat/jakartaee/MigrationCLI.java| 4 
 .../resources/org/apache/tomcat/jakartaee/LocalStrings.properties  | 7 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/MigrationCLI.java 
b/src/main/java/org/apache/tomcat/jakartaee/MigrationCLI.java
index 6c12a09..152e725 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/MigrationCLI.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/MigrationCLI.java
@@ -37,6 +37,7 @@ public class MigrationCLI {
 private static final String LOGLEVEL_ARG = "-logLevel=";
 private static final String PROFILE_ARG = "-profile=";
 private static final String ZIPINMEMORY_ARG = "-zipInMemory";
+private static final String MATCHEXCLUDESPATH_ARG 
="-matchExcludesAgainstPathName";
 
 /**
  * Build the migration tool CLI instance.
@@ -91,6 +92,9 @@ public class MigrationCLI {
 } else if (argument.equals(ZIPINMEMORY_ARG)) {
 iter.remove();
 migration.setZipInMemory(true);
+} else if (argument.equals(MATCHEXCLUDESPATH_ARG)) {
+iter.remove();
+migration.setMatchExcludesAgainstPathName(true);
 }
 }
 
diff --git 
a/src/main/resources/org/apache/tomcat/jakartaee/LocalStrings.properties 
b/src/main/resources/org/apache/tomcat/jakartaee/LocalStrings.properties
index 1b30a94..003ecaf 100644
--- a/src/main/resources/org/apache/tomcat/jakartaee/LocalStrings.properties
+++ b/src/main/resources/org/apache/tomcat/jakartaee/LocalStrings.properties
@@ -49,7 +49,12 @@ where options includes:\n\
 \exception while processing a zip file, enabling this option\n\
 \may workaround the issue by processing the archive in 
memory.\n\
 \This requires more memory than a streaming approach but is\n\
-\able to handle a wider range of zip archive structures.
+\able to handle a wider range of zip archive structures.\n\
+\-matchExcludesAgainstPathName\n\
+\By default, exclusions are matched against file name. If 
this\n\
+\option is enabled, exclusions will be matched against the 
full\n\
+\path.
+
 migration.warnSignatureRemoval=Removed cryptographic signature from JAR file
 
 passThroughConverter.noConversion=No conversion necessary for [{0}]


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



[tomcat-jakartaee-migration] branch main updated: Update change log

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new 621234f  Update change log
621234f is described below

commit 621234fb498a20db1c694b305d371640e3fb994e
Author: Mark Thomas 
AuthorDate: Mon Apr 17 20:36:55 2023 +0100

Update change log
---
 CHANGES.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index d254010..3af0e99 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,8 +3,10 @@
 ## 1.0.7
 
 - When converting directories, rename files according to the chosen profile. 
(fschumacher)
+- Add configuration option, `matchExcludesAgainstPathName` that can be used to 
configure exclusions base don path name rather than just file name.  
PR[#38](https://github.com/apache/tomcat-jakartaee-migration/pull/38) provided 
by Réda Housni Alaoui (markt)
 - Update OSGI servlet specification versions if present in manifest file. 
PR[#42](https://github.com/apache/tomcat-jakartaee-migration/pull/42) provided 
by Ivan Furnadjiev (markt)
 
+
 ## 1.0.6
 
 - Fix handling of javax.annotation package in 1.0.5. PR 
[#40](https://github.com/apache/tomcat-jakartaee-migration/pull/40) provided by 
Danny Thomas (remm)


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



Re: [VOTE] Release Apache Tomcat 9.0.74

2023-04-17 Thread Tim Funk
On Thu, Apr 13, 2023 at 4:43 AM Rémy Maucherat  wrote:

>
> The proposed 9.0.74 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 9.0.74
>
>
>


[tomcat-jakartaee-migration] branch main updated: Allow to match excludes against path name

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new b698c2b  Allow to match excludes against path name
b698c2b is described below

commit b698c2b831aafe343c8bba0b670f7302fa6a524a
Author: Réda Housni Alaoui 
AuthorDate: Tue Nov 22 18:05:15 2022 +0100

Allow to match excludes against path name
---
 src/main/java/org/apache/tomcat/jakartaee/Migration.java   | 14 +-
 .../java/org/apache/tomcat/jakartaee/MigrationTask.java| 10 ++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java 
b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
index 62660dd..950ce23 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
@@ -94,6 +94,7 @@ public class Migration {
 private EESpecProfile profile = EESpecProfiles.TOMCAT;
 
 private boolean enableDefaultExcludes = true;
+private boolean matchExcludesAgainstPathName;
 private boolean zipInMemory;
 private boolean converted;
 private State state = State.NOT_STARTED;
@@ -161,6 +162,14 @@ public class Migration {
 this.enableDefaultExcludes = enableDefaultExcludes;
 }
 
+/**
+ * Enable exclude matching against the path name.
+ * @param matchExcludesAgainstPathName true to match excludes against the 
path name instead of the file name
+ */
+public void setMatchExcludesAgainstPathName(boolean 
matchExcludesAgainstPathName) {
+this.matchExcludesAgainstPathName = matchExcludesAgainstPathName;
+}
+
 /**
  * Buffer all conversion operations for compressed archives in memory.
  * @param zipInMemory true to buffer in memory
@@ -403,7 +412,10 @@ public class Migration {
 return true;
 }
 
-if (GlobMatcher.matchName(excludes, filename, true)) {
+if (!matchExcludesAgainstPathName && GlobMatcher.matchName(excludes, 
filename, true)) {
+return true;
+}
+if (matchExcludesAgainstPathName && GlobMatcher.matchName(excludes, 
name, true)) {
 return true;
 }
 
diff --git a/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java 
b/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java
index 24a9b1f..244f196 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java
@@ -39,6 +39,7 @@ public class MigrationTask extends Task {
 private String profile = EESpecProfiles.TOMCAT.toString();
 private boolean zipInMemory = false;
 private String excludes;
+private boolean matchExcludesAgainstPathName;
 
 /**
  * Set the source file.
@@ -82,6 +83,14 @@ public class MigrationTask extends Task {
 this.excludes = excludes;
 }
 
+/**
+ * Enable exclude matching against the path name.
+ * @param matchExcludesAgainstPathName true to match excludes against the 
path name instead of the file name
+ */
+public void setMatchExcludesAgainstPathName(boolean 
matchExcludesAgainstPathName) {
+this.matchExcludesAgainstPathName = matchExcludesAgainstPathName;
+}
+
 @Override
 public void execute() throws BuildException {
 // redirect the log messages to Ant
@@ -105,6 +114,7 @@ public class MigrationTask extends Task {
 migration.setDestination(dest);
 migration.setEESpecProfile(profile);
 migration.setZipInMemory(zipInMemory);
+
migration.setMatchExcludesAgainstPathName(matchExcludesAgainstPathName);
 if (this.excludes != null) {
 String[] excludes= this.excludes.split(",");
 for (String exclude : excludes) {


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



[GitHub] [tomcat-jakartaee-migration] markt-asf merged pull request #38: Allow to match excludes against path name instead of file name

2023-04-17 Thread via GitHub


markt-asf merged PR #38:
URL: https://github.com/apache/tomcat-jakartaee-migration/pull/38


-- 
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-jakartaee-migration] branch main updated: Update change log

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new b0fb17b  Update change log
b0fb17b is described below

commit b0fb17baa931bb99c17c4f8df10f52b82dfa0bda
Author: Mark Thomas 
AuthorDate: Mon Apr 17 20:33:29 2023 +0100

Update change log
---
 CHANGES.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGES.md b/CHANGES.md
index de8ff50..d254010 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,7 @@
 ## 1.0.7
 
 - When converting directories, rename files according to the chosen profile. 
(fschumacher)
+- Update OSGI servlet specification versions if present in manifest file. 
PR[#42](https://github.com/apache/tomcat-jakartaee-migration/pull/42) provided 
by Ivan Furnadjiev (markt)
 
 ## 1.0.6
 


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



[tomcat-jakartaee-migration] branch main updated: Fix compilation issue

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new f8e793a  Fix compilation issue
f8e793a is described below

commit f8e793a07f07d0b3a55586b2635c25115c290a1a
Author: Mark Thomas 
AuthorDate: Mon Apr 17 20:29:43 2023 +0100

Fix compilation issue

StringBuffer is fine here. It is a local variable.
---
 src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
index f3516ab..63aef73 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
@@ -130,7 +130,7 @@ public class ManifestConverter implements Converter {
 // Update package names in values
 for (Entry entry : attributes.entrySet()) {
 String newValue = profile.convert((String) entry.getValue());
-newValue = replaceVersion(newValue);
+newValue = replaceVersion(newValue);
 // Object comparison is deliberate
 if (newValue != entry.getValue()) {
 entry.setValue(newValue);
@@ -139,15 +139,15 @@ public class ManifestConverter implements Converter {
 }
 return converted;
 }
-
+
 private String replaceVersion(String entryValue) {
 if (entryValue.contains("jakarta.servlet")) {
-StringBuilder builder = new StringBuilder();
+StringBuffer builder = new StringBuffer();
 Matcher matcher = 
Pattern.compile("jakarta.servlet([^,]*);version=\"(.*?)\"").matcher(entryValue);
 while (matcher.find()) {
 matcher.appendReplacement(builder, 
"jakarta.servlet$1;version=\"[5.0.0,7.0.0)\"");
 }
-matcher.appendTail(builder);
+matcher.appendTail(builder);
 return builder.toString();
 }
 return entryValue;


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



[GitHub] [tomcat-jakartaee-migration] markt-asf commented on pull request #42: Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

2023-04-17 Thread via GitHub


markt-asf commented on PR #42:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/42#issuecomment-1511962978

   Thanks for the PR. I think there is probably more to do here (EL, WebSocket, 
etc) and possible some debate to be had regarding exactly which version numbers 
to use in the replacement but this fixes a problem uses are seeing now so I 
think it makes sense to merge this now and address any remaining concerns in 
new issues and/or PRs.


-- 
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-jakartaee-migration] branch main updated: Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

2023-04-17 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-jakartaee-migration.git


The following commit(s) were added to refs/heads/main by this push:
 new df6501d  Set jakarta.servlet.* version range to [5.0.0,7.0.0] if 
specified
df6501d is described below

commit df6501daf8c6eb9131a3b9e330311e868fa4152e
Author: Ivan Furnadjiev 
AuthorDate: Thu Jan 26 12:56:27 2023 +0200

Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

If javax.servlet.* packages are imported with version constraints
in the MANIFEST.MF, the conversion should fix this range to the one
corresponding to jakarta.servlet.* spec [5.0.0,7.0.0]. Otherwise,
in OSGi environment the conversion leads to broken application.

Fix #39
---
 .../org/apache/tomcat/jakartaee/ManifestConverter.java   | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
index d07435f..f3516ab 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ManifestConverter.java
@@ -29,6 +29,8 @@ import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.commons.io.IOUtils;
 
@@ -128,6 +130,7 @@ public class ManifestConverter implements Converter {
 // Update package names in values
 for (Entry entry : attributes.entrySet()) {
 String newValue = profile.convert((String) entry.getValue());
+newValue = replaceVersion(newValue);
 // Object comparison is deliberate
 if (newValue != entry.getValue()) {
 entry.setValue(newValue);
@@ -136,4 +139,17 @@ public class ManifestConverter implements Converter {
 }
 return converted;
 }
+
+private String replaceVersion(String entryValue) {
+if (entryValue.contains("jakarta.servlet")) {
+StringBuilder builder = new StringBuilder();
+Matcher matcher = 
Pattern.compile("jakarta.servlet([^,]*);version=\"(.*?)\"").matcher(entryValue);
+while (matcher.find()) {
+matcher.appendReplacement(builder, 
"jakarta.servlet$1;version=\"[5.0.0,7.0.0)\"");
+}
+matcher.appendTail(builder);
+return builder.toString();
+}
+return entryValue;
+}
 }


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



[GitHub] [tomcat-jakartaee-migration] markt-asf closed issue #39: Fix (remove) "javax.servlet.*" package version when processing the MANIFEST.MF

2023-04-17 Thread via GitHub


markt-asf closed issue #39: Fix (remove) "javax.servlet.*" package version when 
processing the MANIFEST.MF
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/39


-- 
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



[GitHub] [tomcat-jakartaee-migration] markt-asf merged pull request #42: Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified

2023-04-17 Thread via GitHub


markt-asf merged PR #42:
URL: https://github.com/apache/tomcat-jakartaee-migration/pull/42


-- 
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



[GitHub] [tomcat-jakartaee-migration] ebourg commented on issue #46: "java.util.zip.ZipException: invalid CEN header (bad signature)" when opening migrated jar with `java.util.zip.ZipFile`

2023-04-17 Thread via GitHub


ebourg commented on issue #46:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/issues/46#issuecomment-1511775702

   I tried disabling the zip64 mode and the migration fails with:
   
   ```
   Exception in thread "main" 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.Zip64RequiredException:
 Archive's size exceeds the limit of 4GByte.
   at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.createCentralFileHeader(ZipArchiveOutputStream.java:766)
   at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.writeCentralDirectoryInChunks(ZipArchiveOutputStream.java:1792)
   at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:1031)
   at 
org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:633)
   at 
org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:323)
   at 
org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:383)
   at 
org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:274)
   at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:241)
   at 
org.apache.tomcat.jakartaee.MigrationCLI.main(MigrationCLI.java:107)
   ```
   
   It smells like a bug in commons-compress.
   


-- 
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



[GitHub] [tomcat-jakartaee-migration] ebourg commented on issue #46: "java.util.zip.ZipException: invalid CEN header (bad signature)" when opening migrated jar with `java.util.zip.ZipFile`

2023-04-17 Thread via GitHub


ebourg commented on issue #46:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/issues/46#issuecomment-1511773166

   I have been able to reproduce the issue. Even if Tomcat 10.1 doesn't need to 
be migrated the use of a zip64 entry is questionable. The same issue could 
affect another jar unrelated to Tomcat.


-- 
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



[GitHub] [tomcat-jakartaee-migration] markt-asf closed issue #46: "java.util.zip.ZipException: invalid CEN header (bad signature)" when opening migrated jar with `java.util.zip.ZipFile`

2023-04-17 Thread via GitHub


markt-asf closed issue #46: "java.util.zip.ZipException: invalid CEN header 
(bad signature)" when opening migrated jar with `java.util.zip.ZipFile`
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/46


-- 
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



[GitHub] [tomcat-jakartaee-migration] markt-asf commented on issue #46: "java.util.zip.ZipException: invalid CEN header (bad signature)" when opening migrated jar with `java.util.zip.ZipFile`

2023-04-17 Thread via GitHub


markt-asf commented on issue #46:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/issues/46#issuecomment-1511753986

   Tomcat 10.1.x already uses the Jakarta EE APIs so there is no need to run a 
conversion tool on this JAR.


-- 
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



[GitHub] [tomcat-jakartaee-migration] hungvietnguyen opened a new issue, #46: "java.util.zip.ZipException: invalid CEN header (bad signature)" when opening migrated jar with `java.util.zip.ZipFile`

2023-04-17 Thread via GitHub


hungvietnguyen opened a new issue, #46:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/46

   ### Context
   
   I'm investigating https://youtrack.jetbrains.com/issue/KT-57767 where the 
build fails when reading 
   
[tomcat-embed-core-10.1.7-jakartaee.jar](https://github.com/apache/tomcat-jakartaee-migration/files/11252858/tomcat-embed-core-10.1.7-jakartaee.zip)
   
   *(Note: If you download the above file, you'll get a `.zip` file because 
GitHub doesn't accept uploading `.jar`s so I had to rename it to `.zip`.)*
   
   That jar was converted from 
[tomcat-embed-core-10.1.7.jar](https://repo1.maven.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/10.1.7/tomcat-embed-core-10.1.7.jar)
 by the [Gradle Jakarta EE Migration 
plugin](https://github.com/nebula-plugins/gradle-jakartaee-migration-plugin), 
which uses the [Apache Tomcat migration tool for Jakarta 
EE](https://github.com/apache/tomcat-jakartaee-migration).
   
   If I open the migrated jar using 
[java.util.zip.ZipInputStream](http://www.java2s.com/Tutorial/Java/0180__File/UnzipusingtheZipInputStream.htm),
 I'll get: 
   ```
   java.util.zip.ZipException: invalid entry size (expected 0 but got 913 bytes)
   ```
   
   If I open it using 
[java.util.zip.ZipFile](https://jenkov.com/tutorials/java-zip/zipfile.html), 
I'll get:
   ```
   java.util.zip.ZipException: invalid CEN header (bad signature)
   ```
   
   This suggests that there is a bug in either `ZipInputStream` (e.g., 
https://bugs.openjdk.org/browse/JDK-8298530), `ZipFile`, the 
`tomcat-jakartaee-migration` tool, or a combination of them.
   
   ### Request
   
   Please investigate whether this is a bug in the `tomcat-jakartaee-migration` 
tool.
   
   Even if it isn't, it would still be nice to change the way the tool 
generates migrated jars such that they can be read by `ZipInpuStream` or 
`ZipFile` API.


-- 
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.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: [VOTE] Release Apache Tomcat 8.5.88

2023-04-17 Thread Felix Schumacher


Am 14.04.23 um 22:38 schrieb Christopher Schultz:

The proposed Apache Tomcat 8.5.88 release is now available for voting.

The notable changes compared to 8.5.87 are:

- Reduce the default value of maxParameterCount from 10,000 to 1,000.

- Correct a regression in the fix for bug 66442 that meant that streams
  without a response body did not decrement the active stream count
  when completing, leading to
  ERR_HTTP2_SERVER_REFUSED_STREAM for some connections.

- Refactor synchronization blocks locking on SocketWrapper to use
  ReentrantLock to support users wishing to experiment with project
  Loom.

- Implement RFC 9239; note the MIME types for Javascript has changed
  to text/javascript.

Along with lots of other bug fixes and improvements.

For full details, see the changelog:
https://nightlies.apache.org/tomcat/tomcat-8.5.x/docs/changelog.html

It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.5.88/

The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-1430

The tag is:
https://github.com/apache/tomcat/tree/8.5.88/


The proposed 8.5.88 release is:
[ ] Broken - do not release
[x] Stable - go ahead and release as 8.5.88 (stable)


Unit test run fine under Linux.

Felix



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

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



OpenPGP_0xEA6C3728EA91C4AF.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [VOTE] Release Apache Tomcat 8.5.88

2023-04-17 Thread Rémy Maucherat
On Fri, Apr 14, 2023 at 10:38 PM Christopher Schultz
 wrote:
>
> The proposed Apache Tomcat 8.5.88 release is now available for voting.
>
> The notable changes compared to 8.5.87 are:
>
> - Reduce the default value of maxParameterCount from 10,000 to 1,000.
>
> - Correct a regression in the fix for bug 66442 that meant that streams
>without a response body did not decrement the active stream count
>when completing, leading to
>ERR_HTTP2_SERVER_REFUSED_STREAM for some connections.
>
> - Refactor synchronization blocks locking on SocketWrapper to use
>ReentrantLock to support users wishing to experiment with project
>Loom.
>
> - Implement RFC 9239; note the MIME types for Javascript has changed
>to text/javascript.
>
> Along with lots of other bug fixes and improvements.
>
> For full details, see the changelog:
> https://nightlies.apache.org/tomcat/tomcat-8.5.x/docs/changelog.html
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.5.88/
>
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1430
>
> The tag is:
> https://github.com/apache/tomcat/tree/8.5.88/
>
>
> The proposed 8.5.88 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.5.88 (stable)

Rémy

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



Re: [VOTE] Release Apache Tomcat 8.5.88

2023-04-17 Thread Mark Thomas

On 16/04/2023 18:59, Mark Thomas wrote:

On 14/04/2023 21:38, Christopher Schultz wrote:


The proposed 8.5.88 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 8.5.88 (stable)


Build is reproducible on Windows x64 but not Linux x64.

Unit tests pass on Linux x64, Windows x64, MacOS M1 and MacOS x64.

It appears the compiler constructs a slightly different class for 
NioEndpoint$Poller when compiling on Linux x64. I started to dig into 
why but didn't reach a conclusion. Investigating further is on my TODO 
list.


I have made some progress. The difference is in how the following line 
is handled (there are other differences but this is the first and the 
other differences may be as a result of this one).


https://github.com/apache/tomcat/blob/8.5.x/java/org/apache/tomcat/util/net/NioEndpoint.java#L846

When compiling on Windows with Java 11 targeting Java 7 the following 
byte code is generated:


...
126:  aload %4
128:  invokevirtual	org.apache.tomcat.util.net.NioChannel.getIOChannel 
()Ljava/nio/channels/SocketChannel; (32)

131:  checkcast  (121)
134:  astore%6
...

When compiling on Linux with Java 11 targeting Java 7 the checkcast 
command is not present. Neither is it present when compiling on Windows 
with Java 11 targeting Java 8.


This is arguably a bug in the compiler - the byte code should be the 
same across platforms - but having researched things this far, I don't 
plan to pursue this further.


Mark

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



Re: [VOTE] Release Apache Tomcat 10.1.8

2023-04-17 Thread Rémy Maucherat
On Fri, Apr 14, 2023 at 10:08 PM Christopher Schultz
 wrote:
>
> The proposed Apache Tomcat 10.1.8 release is now available for
> voting.
>
> The notable changes compared to 10.1.7 are:
>
> - Reduce the default value of maxParameterCount from 10,000 to 1,000.
>
> - Correct a regression in the fix for bug 66442 that meant that streams
>without a response body did not decrement the active stream count
>when completing leading to ERR_HTTP2_SERVER_REFUSED_STREAM for some
>connections.
>
> - Expand the validation of the value of the Sec-Websocket-Key header in
>the HTTP upgrade request that initiates a WebSocket connection. The
>value is not decoded but it is checked for the correct length and that
>only valid characters from the base64 alphabet are used.
>
> - Implement RFC 9239; note the MIME types for Javascript has changed
>to text/javascript.
>
> For full details, see the change log:
> https://nightlies.apache.org/tomcat/tomcat-10.1.x/docs/changelog.html
>
> Applications that run on Tomcat 9 and earlier will not run on Tomcat 10
> without changes. Java EE applications designed for Tomcat 9 and earlier
> may be placed in the $CATALINA_BASE/webapps-javaee directory and Tomcat
> will automatically convert them to Jakarta EE and copy them to the
> webapps directory.
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-10/v10.1.8/
>
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1429
>
> The tag is:
> https://github.com/apache/tomcat/tree/10.1.8
> 477b206c9f05d2e70438a440bd40ab523662
>
> The proposed 10.1.8 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 10.1.8

Rémy

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