apache / ignite

Apache Ignite
https://ignite.apache.org/
Apache License 2.0
4.78k stars 1.9k forks source link

Apache Ignite 2.15.0 startup failure using OpenJDK 17 version #10747

Closed Indupa closed 5 months ago

Indupa commented 1 year ago

Hi ,

Iam currently using Apache Ignite of version 2.15.0 . But Iam unable to Run Ignite using JDK version of 17 .

What version of JDK to be installed to run Apche Ignite 2.15.0 .....?

Could you please help me on this...?

ivandasch commented 1 year ago

Hi, yes, ignite supports running on jvm 15 and higher

You should add this to jvm options:

   --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \
          --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
          --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
          --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
          --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
          --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
          --add-opens=java.base/java.io=ALL-UNNAMED \
          --add-opens=java.base/java.nio=ALL-UNNAMED \
          --add-opens=java.base/java.util=ALL-UNNAMED \
          --add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
          --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED \
          --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
          --add-opens=java.base/java.lang=ALL-UNNAMED \
          --add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
          --add-opens=java.base/java.math=ALL-UNNAMED \
          --add-opens=java.sql/java.sql=ALL-UNNAMED \
Indupa commented 1 year ago

Jvm options in the sense, where i have to add these configuration or in which file ...?

Note : I am running Ignite on Windows Server

ivandasch commented 1 year ago

If ignite is started using "ignite.sh", it will work as is, just tested on openjdk 17.0.6.

If ignite is embedded, it is required to add these options to the application's start script.

Here is an example how to set jvm options: https://opensource.com/article/22/4/jvm-parameters-java-developers

sergeykad commented 1 year ago

Are there plans to create an official Docker image based on Java 17?

Indupa commented 1 year ago

Hi , In our project , ignite is started using "Topshelf" command to run as windows service by passing JAVA_HOME as one of the Argument.

when i tried to run Apche Ignite 2.15.0 with OpenJDK 17, Its not working. Can you please provide information on this.....?

Note : I am running Ignite on Windows Server

Getting the following error when i tried to start Ignite 2.15 with jdk 17

2023-06-26 14:56:49.514 [ERR] Exception while starting ignite service. Apache.Ignite.Core.Common.IgniteException: Java exception occurred [class=java.lang.ExceptionInInitializerError, message=] ---> Apache.Ignite.Core.Common.JavaException: java.lang.ExceptionInInitializerError at org.apache.ignite.internal.processors.platform.memory.PlatformAbstractMemory.(PlatformAbstractMemory.java:27) at org.apache.ignite.internal.processors.platform.PlatformAbstractBootstrap.init(PlatformAbstractBootstrap.java:54) at org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:65) Caused by: java.lang.RuntimeException: java.nio.DirectByteBuffer.address field is unavailable. at org.apache.ignite.internal.util.GridUnsafe$2.run(GridUnsafe.java:1570) at org.apache.ignite.internal.util.GridUnsafe$2.run(GridUnsafe.java:1557) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at org.apache.ignite.internal.util.GridUnsafe.bufferAddressOffset(GridUnsafe.java:1557) at org.apache.ignite.internal.util.GridUnsafe.(GridUnsafe.java:109) ... 3 more Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @4b85612c at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) at java.base/java.lang.reflect.Field.setAccessible(Field.java:172) at org.apache.ignite.internal.util.GridUnsafe$2.run(GridUnsafe.java:1562) ... 7 more

at Apache.Ignite.Core.Impl.Unmanaged.Jni.Env.ExceptionCheck() at Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils.IgnitionStart(Env env, String cfgPath, String gridName, Boolean clientMode, Boolean userLogger, Int64 igniteId, Boolean redirectConsole) at Apache.Ignite.Core.Ignition.Start(IgniteConfiguration cfg) --- End of inner exception stack trace --- at Apache.Ignite.Core.Ignition.Start(IgniteConfiguration cfg)

Indupa commented 1 year ago

Hii,

Can you please help me on resolving this issue....?

Harinath2306 commented 1 year ago

Hi,

I'm facing similar issue. All the jvm options that are listed are present in jvmdefaults.sh, but still facing the same issue

Is there any workaround for this issue? Can you please help by updating on this.

Thanks, Harinath

sergeykad commented 1 year ago

Works for me with these:

--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED
--add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
Indupa commented 1 year ago

above issue is now not exist in my environment ,but getting below error even though i have 16GB of free memory in my environment and other environments as well.

Service cannot be started. Apache.Ignite.Core.Common.IgniteException: Java exception occurred [class=java.lang.OutOfMemoryError, message=Java heap space] ---> Apache.Ignite.Core.Common.JavaException: java.lang.OutOfMemoryError: Java heap space at org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils.readIgniteConfiguration(PlatformConfigurationUtils.java:773) at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.processPrepareResult(PlatformDotNetConfigurationClosure.java:195) at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.prepare(PlatformDotNetConfigurationClosure.java:182) at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.apply0(PlatformDotNetConfigurationClosure.java:110) at org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure.apply(PlatformAbstractConfigurationClosure.java:50) at org.apache.ignite.internal.processors.platform.PlatformAbst...

NSAmelchev commented 9 months ago

@Indupa The Apache Ignite 2.16.0 released. Please check if the issue is still relevant?

https://ignite.apache.org/blog/apache-ignite-2-16-0.html

Litvinovis commented 3 months ago

So i faced the same problem when i start Ignite on windows 10, this solved in my case: 1) switch to ignite 2.16 2) added VM option: --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED