node-java icon indicating copy to clipboard operation
node-java copied to clipboard

JNI attached native thread (null caller frame) cannot access a member of class java.util.ArrayList$Itr (in module java.base) with modifiers "public"

Open Heath123 opened this issue 5 years ago • 1 comments

image Text error (I used OCR so some things might be wrong):

Uncaught Exception:
Error: Error running instance method
java.lang.IllegalAccessException: JNI attached native thread (null caller frame) cannot access a member of class java.util.ArrayList$Itr (in module
java.base) with modifiers "public"
    at java.base/-
jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:406)
    at java.base/
jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:349)
    at java.base/-
java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:647)
    at java.base/java.lang.reflect.Method.invoke (Method.java:556)
at Timeout._onTimeout (home/heath/synced Projects/pakkit/src/proxy/bedrock/proxy.js:88:54)
    at listOnTimeout (internal/timers.js:531:17)
    at process Timers (internal/timers.js:475:7)

Code (JS):

console.log(proxyPass.packetQueue.iteratorSync().nextSync())

Property (Java) that it's accessing:

public static ArrayList<JsonPacketData> packetQueue = new ArrayList<>();

Seems to be related to https://bugs.openjdk.java.net/browse/JDK-8221530, as it says null caller frame? But I think I'm using Java 14 so that should be fixed?

Heath123 avatar Dec 16 '20 17:12 Heath123

Seeing this same issue using Java 17. Is there a fix or a work around?

mmurph7777 avatar Jun 15 '22 15:06 mmurph7777