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

sk0x50 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 55a3e70607 IGNITE-23221 Update a message about java version and jvm 
startup params  (#4408)
55a3e70607 is described below

commit 55a3e706072d112f229878ce450bfcc0ba4bd7d9
Author: Mikhail Efremov <[email protected]>
AuthorDate: Tue Sep 17 19:50:22 2024 +0600

    IGNITE-23221 Update a message about java version and jvm startup params  
(#4408)
---
 .../internal/util/BrokenPointerWrapping.java       |  2 +-
 .../ignite/internal/util/FeatureChecker.java       | 36 ++++++++++------------
 .../apache/ignite/internal/util/GridUnsafe.java    |  8 ++---
 .../internal/util/JavaNioPointerWrapping.java      |  2 +-
 .../raft/storage/logit/LogitLogStorageFactory.java |  2 +-
 5 files changed, 24 insertions(+), 26 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/BrokenPointerWrapping.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/BrokenPointerWrapping.java
index add4eaa18d..7f0f5ad6db 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/BrokenPointerWrapping.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/BrokenPointerWrapping.java
@@ -26,6 +26,6 @@ class BrokenPointerWrapping implements PointerWrapping {
     @Override
     public ByteBuffer wrapPointer(long ptr, int len) {
         throw new RuntimeException(
-                "All alternatives for a new DirectByteBuffer() creation 
failed: " + FeatureChecker.JAVA_VER_SPECIFIC_WARN);
+                "All alternatives for a new DirectByteBuffer() creation 
failed: " + FeatureChecker.JAVA_STARTUP_PARAMS_WARN);
     }
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
index 6b1f1b6e0c..93f91318d8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
@@ -21,23 +21,21 @@ package org.apache.ignite.internal.util;
  * Class extracted for fields from GridUnsafe to be absolutely independent 
with current and future static block initialization effects.
  */
 public class FeatureChecker {
-    /** Required options to run on Java 9, 10, 11. */
-    public static final String JAVA_9_10_11_OPTIONS = ""
-            + "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED\n"
-            + "--add-exports=java.base/jdk.internal.access=ALL-UNNAMED\n"
-            + "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED\n"
-            + 
"--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED\n"
-            + 
"--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED\n"
-            + 
"--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED\n"
-            + 
"--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED\n"
-            + "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED\n"
-            + "--illegal-access=permit";
-
-    /** Java version specific warning to be added in case access failed. */
-    public static final String JAVA_VER_SPECIFIC_WARN =
-            "\nPlease add the following parameters to JVM startup settings and 
restart the application: {parameters: "
-                    + JAVA_9_10_11_OPTIONS
-                    + "\n}"
-                    + "\nSee 
https://apacheignite.readme.io/docs/getting-started#section-running-ignite-with-java-9-10-11
 "
-                    + "for more information.";
+    /** Java specific startup parameters warning to be added in case access 
failed. */
+    public static final String JAVA_STARTUP_PARAMS_WARN = 
System.lineSeparator()
+            + "Please check the required parameters to JVM startup settings 
and restart the application."
+            + " Parameters: " + System.lineSeparator()
+            + "\t--add-opens java.base/java.lang=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.lang.invoke=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.lang.reflect=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.io=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.nio=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.math=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.util=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/java.time=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/jdk.internal.misc=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/jdk.internal.access=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t--add-opens java.base/sun.nio.ch=ALL-UNNAMED" + 
System.lineSeparator()
+            + "\t-Dio.netty.tryReflectionSetAccessible=true" + 
System.lineSeparator()
+            + " See 
https://ignite.apache.org/docs/3.0.0-beta/quick-start/getting-started-guide for 
more information.";
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java 
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
index 22049de63b..da35b01065 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
@@ -213,7 +213,7 @@ public abstract class GridUnsafe {
             return newDirectBuf.order(NATIVE_BYTE_ORDER);
         } catch (Throwable e) {
             throw new RuntimeException("DirectByteBuffer#constructor is 
unavailable."
-                    + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+                    + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 
@@ -232,7 +232,7 @@ public abstract class GridUnsafe {
             return newDirectBuf.order(NATIVE_BYTE_ORDER);
         } catch (Throwable e) {
             throw new RuntimeException("DirectByteBuffer#constructor is 
unavailable."
-                    + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+                    + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 
@@ -1619,7 +1619,7 @@ public abstract class GridUnsafe {
             return mth.invoke(null);
         } catch (ReflectiveOperationException e) {
             throw new RuntimeException(pkgName + ".JavaNioAccess class is 
unavailable."
-                    + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+                    + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 
@@ -1655,7 +1655,7 @@ public abstract class GridUnsafe {
                     .asType(mtdType);
         } catch (ReflectiveOperationException | PrivilegedActionException e) {
             throw new RuntimeException(accessPackage() + 
".JavaNioAccess#newDirectByteBuffer() method is unavailable."
-                    + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+                    + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/JavaNioPointerWrapping.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/JavaNioPointerWrapping.java
index 22e5ab5789..049978f870 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/JavaNioPointerWrapping.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/JavaNioPointerWrapping.java
@@ -47,7 +47,7 @@ class JavaNioPointerWrapping implements PointerWrapping {
             return buf;
         } catch (Throwable e) {
             throw new RuntimeException("JavaNioAccess#newDirectByteBuffer() 
method is unavailable."
-                    + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+                    + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 }
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
index a620868f2e..3bcd788fb9 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
@@ -77,7 +77,7 @@ public class LogitLogStorageFactory implements 
LogStorageFactory {
         try {
             Class.forName(DirectBuffer.class.getName());
         } catch (Throwable e) {
-            throw new IgniteInternalException("sun.nio.ch.DirectBuffer is 
unavailable." + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+            throw new IgniteInternalException("sun.nio.ch.DirectBuffer is 
unavailable." + FeatureChecker.JAVA_STARTUP_PARAMS_WARN, e);
         }
     }
 

Reply via email to