Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"superclass access check failed" when attemting to load JSRuntime #627

Open
bakkot opened this issue Aug 9, 2022 · 1 comment
Open

"superclass access check failed" when attemting to load JSRuntime #627

bakkot opened this issue Aug 9, 2022 · 1 comment

Comments

@bakkot
Copy link

bakkot commented Aug 9, 2022

JSRuntime.doubleToString(36893488147419103000.0, 10)

errors out with

Exception in thread "main" java.lang.IllegalAccessError: superclass access check failed: class com.oracle.truffle.js.runtime.GraalJSException (in unnamed module @0x6ce253f1) cannot access class com.oracle.truffle.api.exception.AbstractTruffleException (in module org.graalvm.truffle) because module org.graalvm.truffle does not export com.oracle.truffle.api.exception to unnamed module @0x6ce253f1
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at com.bakkot.graalissue.Main.main(Main.java:7)

Is JSRuntime not supposed to be public? If it is, is there a way to make this work? Note that the method I'm attempting to call cannot throw a GraalJSException (it can't throw at all, in fact).

If JSRuntime isn't supposed to be public, is there a way I could have known that (given that it's explicitly marked as public)? Is there a documented list of public classes or something?

@iamstolis
Copy link
Member

If JSRuntime isn't supposed to be public, is there a way I could have known that (given that it's explicitly marked as public)? Is there a documented list of public classes or something?

There is no JavaScript-specific Java API in GraalVM. All the Java classes in graal-js (like com.oracle.truffle.js.*) are implementation details and as such are not supposed to be used by graal-js clients directly. graal-js (like other language implementations in GraalVM) should be accessed using language-agnostic org.graalvm.* APIs, most notably org.graalvm.polyglot.Context/Value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants