From 716684b05a3c5324e2f02854a28c971180f2da41 Mon Sep 17 00:00:00 2001 From: Romain Bioteau Date: Thu, 26 Oct 2023 14:12:07 +0200 Subject: [PATCH] fix(start): add required java modules for hazelcast optimal performence (#599) See https://docs.hazelcast.com/imdg/4.2/installation/running-in-modular-java Closes RUNTIME-1775 --- docker/templates/setenv.sh | 10 ++++++++++ .../src/main/resources/tomcat/server/bin/setenv.bat | 10 ++++++++++ .../src/main/resources/tomcat/server/bin/setenv.sh | 12 +++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docker/templates/setenv.sh b/docker/templates/setenv.sh index c4130da39..cfade3278 100755 --- a/docker/templates/setenv.sh +++ b/docker/templates/setenv.sh @@ -1,5 +1,15 @@ #!/bin/sh +# Add the JAVA 9 specific start-up parameters required by Hazelcast +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-modules=java.se" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.nio=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.management/sun.management=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED" + # Set some JVM system properties required by Bonita LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager" diff --git a/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.bat b/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.bat index 4357674ab..b64b2ad97 100644 --- a/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.bat +++ b/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.bat @@ -5,6 +5,16 @@ rem # Instead, edit the setenv.bat template located in the folder setup/tomca rem # During start-bonita script execution, the template will overwrite this file. # rem #################################################################################################################### +rem Add the JAVA 9 specific start-up parameters required by Hazelcast +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-modules=java.se" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.nio=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.management/sun.management=ALL-UNNAMED" +set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED" + rem Set some JVM system properties required by Bonita rem This variable is automatically taken into account by catalina.bat: diff --git a/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.sh b/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.sh index 72d05f2a5..fd6041f79 100644 --- a/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.sh +++ b/tomcat-resources/tomcat-distrib-for-bonita/src/main/resources/tomcat/server/bin/setenv.sh @@ -1,10 +1,20 @@ #!/bin/sh #################################################################################################################### # WARNING: Do not edit this file. # -# Instead, edit the setenv.sh template located in the folder setup/tomcat-templates. # +# Instead, edit the setenv.sh template located in the folder setup/tomcat-templates. # # During start-bonita script execution, the template will overwrite this file. # #################################################################################################################### +# Add the JAVA 9 specific start-up parameters required by Hazelcast +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-modules=java.se" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.nio=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.management/sun.management=ALL-UNNAMED" +JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED" + # Set some JVM system properties required by Bonita # This variable is automatically taken into account by catalina.sh