[druid-user] non-blocking issue when running Druid 0.23.0 under JDK 11

bin/run-druid coordinator-overlord conf/druid/cluster/master
Running [coordinator-overlord], logging to [/path/build/apache-druid-0.23.0/bin/…/log/coordinator-overlord.log] if no changes made to log4j2.xml
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/path/build/apache-druid-0.23.0/lib/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I see the process is running. it registered itself to ZK successfully.
however in the log: I saw
org.apache.druid.java.util.metrics.AllocationMetricCollectors - Cannot initialize org.apache.druid.java.util.metrics.AllocationMetricCollector
java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.HotSpotThreadImpl.getThreadAllocatedBytes(long) accessible: module jdk.management does not “exports com.sun.management.internal” to unnamed module @72a85671
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) ~[?:?]
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) ~[?:?]
at java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) ~[?:?]
at java.lang.reflect.Method.setAccessible(Method.java:192) ~[?:?]

at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) [guice-4.1.0.jar:?]

at com.google.inject.Guice.createInjector(Guice.java:99) [guice-4.1.0.jar:?]

at com.google.inject.Guice.createInjector(Guice.java:73) [guice-4.1.0.jar:?]

at com.google.inject.Guice.createInjector(Guice.java:62) [guice-4.1.0.jar:?]

at org.apache.druid.initialization.Initialization.makeInjectorWithModules(Initialization.java:449) [druid-server-0.23.0.jar:0.23.0]

at org.apache.druid.cli.GuiceRunnable.makeInjector(GuiceRunnable.java:93) [druid-services-0.23.0.jar:0.23.0]

at org.apache.druid.cli.ServerRunnable.run(ServerRunnable.java:62) [druid-services-0.23.0.jar:0.23.0]

at org.apache.druid.cli.Main.main(Main.java:114) [druid-services-0.23.0.jar:0.23.0]

I already added “–add-exports java.base/jdk.internal.perf=ALL-UNNAMED” to the startup script as below:
exec “$JAVA_BIN”/java --add-exports java.base/jdk.internal.perf=ALL-UNNAMED -Ddruid.node.type=$1…"
do those exceptions matter?
is there a way to work around?

it does not happen to jdk11.04 in my desktop installation,
however, it happened to jdk11.11 in cluster installation.
I googled, seems upgrade to guice 5 will help, but 4.1.0 was in druid 0.23.0.

I found this in connection with the WARNINGs in your first post. Maybe adding VM option --add-opens java.base/java.lang=ALL-UNNAMED will help with the warnings?

mark: thanks for help.
I added this
–add-exports java.base/jdk.internal.perf=ALL-UNNAMED

will try your suggestion
java.base/java.lang=ALL-UNNAMED

yes, it’s not blocking errors.

mark:
FYI: changing it to java.base/java.lang didn’t change anything.

Ellen,

I’m so sorry I was ambiguous in my reply. I should have written a more complete response. Can you try adding both of these VM options:

–add-exports java.base/jdk.internal.perf=ALL-UNNAMED
–add-opens java.base/java.lang=ALL-UNNAMED

I think your original addition was half of the solution. Hopefully the second java.base/java.lang line above will resolve the issue.

Let us know how it goes.

Best,

Mark

I added both:

–add-exports java.base/jdk.internal.perf=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED

I still get this exception.

java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.HotSpotThreadImpl.getThreadAllocatedBytes(long) accessible: module jdk.management does not “exports com.sun.management.internal” to unnamed module @48c35007
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) ~[?:?]
at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) ~[?:?]
at java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) ~[?:?]
at java.lang.reflect.Method.setAccessible(Method.java:192) ~[?:?]
at org.apache.druid.java.util.metrics.AllocationMetricCollectors.(AllocationMetricCollectors.java:41) [druid-core-0.23.0.jar:0.23.0]
at org.apache.druid.java.util.metrics.JvmMonitor.(JvmMonitor.java:79) [druid-core-0.23.0.jar:0.23.0]
at org.apache.druid.java.util.metrics.JvmMonitor.(JvmMonitor.java:70) [druid-core-0.23.0.jar:0.23.0]
at org.apache.druid.java.util.metrics.JvmMonitor.(JvmMonitor.java:65) [druid-core-0.23.0.jar:0.23.0]