Skip to content

JDK 17: javax.script.ScriptException: TypeError #617

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

Closed
thurka opened this issue Dec 13, 2024 · 3 comments
Closed

JDK 17: javax.script.ScriptException: TypeError #617

thurka opened this issue Dec 13, 2024 · 3 comments
Assignees
Labels

Comments

@thurka
Copy link
Member

thurka commented Dec 13, 2024

Describe the bug
Probes from Tracer JVM-Probes module does not work.

To Reproduce
Steps to reproduce the behavior:

  1. Run VisualVM on JDK 17
  2. Install Tracer JVM-Probes module
  3. Open VisualVM itself
  4. Switch to Tracer tab
  5. No probes are displayed and javax.script.ScriptException: TypeError error is printed to logfile

Expected behavior
Probes should be displayed in Tracer tab

VisualVM log
messages.log

Desktop (please complete the following information):

  • OS: macOS
  • JDK version 17
  • Version 2.1.10
@thurka thurka added the bug label Dec 13, 2024
@thurka thurka self-assigned this Dec 13, 2024
@thurka
Copy link
Member Author

thurka commented Dec 13, 2024

Javascript evaluation fails with Can not find a common class loader for ScriptObject and org.graalvm.visualvm.modules.tracer.dynamic.impl.ValueProvider

Caused by: <eval>:98 TypeError: Can not find a common class loader for ScriptObject and org.graalvm.visualvm.modules.tracer.dynamic.impl.ValueProvider.
	at org.openjdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:212)
	at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:184)
	at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:171)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.adaptationException(JavaAdapterFactory.java:273)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory$AdapterInfo.findCommonLoader(JavaAdapterFactory.java:369)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory$AdapterInfo.<init>(JavaAdapterFactory.java:309)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.lambda$createAdapterInfo$1(JavaAdapterFactory.java:268)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.createAdapterInfo(JavaAdapterFactory.java:267)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.lambda$getAdapterInfo$0(JavaAdapterFactory.java:227)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.getAdapterInfo(JavaAdapterFactory.java:227)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.getAdapterClassFor(JavaAdapterFactory.java:163)
	at org.openjdk.nashorn.internal.runtime.linker.JavaAdapterFactory.getAdapterClassFor(JavaAdapterFactory.java:149)
	at org.openjdk.nashorn.internal.runtime.linker.NashornStaticClassLinker.getGuardedInvocation(NashornStaticClassLinker.java:94)
	at jdk.dynalink/jdk.dynalink.linker.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:161)
	at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:109)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(LinkerServicesImpl.java:137)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(LinkerServicesImpl.java:168)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:135)
	at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(DynamicLinker.java:241)
	at org.openjdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:98)

@thurka
Copy link
Member Author

thurka commented Dec 13, 2024

The workaroud: Install GraalJS plugin to use different javascript engine.

@thurka
Copy link
Member Author

thurka commented Dec 30, 2024

Fixed in master.

@thurka thurka closed this as completed Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant