You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rz...@apache.org on 2026/01/04 21:05:31 UTC

(tomee) branch TOMEE-4569 created (now 940434ca02)

This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a change to branch TOMEE-4569
in repository https://gitbox.apache.org/repos/asf/tomee.git


      at 940434ca02 TOMEE-4569 - TomEE Maven Plugin fails in debug mode in Java 22+

This branch includes the following new commits:

     new 940434ca02 TOMEE-4569 - TomEE Maven Plugin fails in debug mode in Java 22+

The 1 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.



(tomee) 01/01: TOMEE-4569 - TomEE Maven Plugin fails in debug mode in Java 22+

Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch TOMEE-4569
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 940434ca02d74490468d4b98845bcd0538d2524e
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Sun Jan 4 22:05:20 2026 +0100

    TOMEE-4569 - TomEE Maven Plugin fails in debug mode in Java 22+
---
 .../main/java/org/apache/openejb/config/RemoteServer.java   | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
index 560dcc1361..379fd3e5d1 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
@@ -238,10 +238,15 @@ public class RemoteServer {
                 argsList.add("-XX:+HeapDumpOnOutOfMemoryError");
 
                 if (debug) {
-                    argsList.add("-Xdebug");
-                    argsList.add("-Xnoagent");
-                    argsList.add("-Djava.compiler=NONE");
-                    argsList.add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=" + options.get(SERVER_DEBUG_PORT, 5005));
+                    final int debugPort = options.get(SERVER_DEBUG_PORT, 5005);
+                    if (System.getProperty("java.vm.specification.version").compareTo("21") < 0) {
+                        argsList.add("-Xdebug");
+                        argsList.add("-Xnoagent");
+                        argsList.add("-Djava.compiler=NONE");
+                        argsList.add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=" + debugPort);
+                    } else {
+                        argsList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=" + debugPort);
+                    }
                 }
 
                 if (profile) {