Repository navigation
Description
Description
The dev loop runs the application on a JetBrains Runtime (JBR) when one is
found, so that a structural change can be redefined without a restart. When
such a change adds or changes a method of an interface that
Element.executeJs(Class) returns a proxy for, the redefine succeeds, but the
next call of the new method fails with AbstractMethodError. A plain apply
after that does not restart, so the error stays until a manual restart.
HotswapAgent's ProxyPlugin should regenerate the JDK proxy class, but it
fails because java.base does not open jdk.internal.loader to it. The dev
loop adds --add-opens java.base/jdk.internal.loader=ALL-UNNAMED only for
the embedded Maven goal runtime (MavenGoalRuntime.extraJvmFlags), not when
it launches the main class (Launch.ADD_OPENS, which has java.lang,
java.lang.reflect, java.io, java.util and java.beans).
The same probably happens for every JDK dynamic proxy of a changed interface,
not only for executeJs(Class). I tested only executeJs(Class).
Steps to reproduce
Branch repro/js-definition-hierarchy-hotswap of
https://github.com/mcollovati/skeleton-starter-flow-spring (Flow main
bf9a1a9 installed locally, JBR 21.0.11).
mvn vaadin:install-dev-cli, then
VAADIN_DEV_DAEMON_OPTS="-Dvaadin.frontend.hotdeploy=true -Dvaadin.dev.javaHome=<JBR 21>" .vaadin/vaadin-dev start.
The daemon log showsenhancedRedefinition=true.- Open http://localhost:8097/ and press "Run DirectJs.show":
direct v1: clicked. - In
DirectJs, change the method toand the call in@JsExpression("this.textContent = 'direct v2: ' + $0 + $1") void show(String value, String extra);
MainViewto.show("clicked", " twice"). - Run
.vaadin/vaadin-dev apply --no-restart, reload the page and press the
button again.
Expected behavior
direct v2: clicked twice
Actual behavior
Nothing changes in the browser. target/devloop/app.log has:
HOTSWAP AGENT: ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.proxy.ProxyPlugin' class 'jdk/proxy2/$Proxy117' ...
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public void jdk.internal.loader.AbstractClassLoaderValue.removeAll(java.lang.ClassLoader) accessible: module java.base does not "exports jdk.internal.loader" to unnamed module ...
ERROR c.v.flow.server.DefaultErrorHandler : Unexpected error: Receiver class jdk.proxy2.$Proxy117 does not define or inherit an implementation of the resolved method 'abstract void show(java.lang.String, java.lang.String)' of interface org.vaadin.example.DirectJs.
java.lang.AbstractMethodError: ...
A following .vaadin/vaadin-dev apply reports redefineClasses(2) with one
error in the app log, and the button still fails.
With .vaadin/vaadin-dev start --jvm-args "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED",
the same steps give direct v2: clicked twice without a restart, and the log
has no error. --add-exports is not needed.
On a JDK that is not a JBR, the redefine is rejected ("attempted to delete a
method") and the dev loop restarts, so the problem does not show there.
Proposed fix
Add java.base/jdk.internal.loader to Launch.ADD_OPENS. The comment in
MavenGoalRuntime.extraJvmFlags already explains that HotswapAgent needs
this package.
Versions
- Flow main bf9a1a9 (also seen with feat: call element method for JsInvokers method without expression #27441 at e04fb83)
- JBR 21.0.11 (b1163.125), HotswapAgent 2.0.4 (from the dev loop)
- Spring Boot 4.1.2, Linux
Activity
totally-not-ai commentedon Nov 26, 2026
Triage: confirmed bug. On a JetBrains Runtime, after a method of an interface with a JDK proxy (such as one from
executeJs(Class)) changes, calling it fails withAbstractMethodErroruntil a manual restart.executeJs(Class).vaadin-dev start --jvm-args "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED", at no cost.jdk.internal.loader, so HotswapAgent's ProxyPlugin cannot regenerate the proxy class.Root cause
Launch.ADD_OPENS, which lacksjava.base/jdk.internal.loader.MavenGoalRuntime.extraJvmFlags, for a different HotswapAgent feature.AbstractClassLoaderValue.removeAllto drop the cached proxy class, which fails withInaccessibleObjectException, so the old proxy class stays.java.netopened (it lets HotswapAgent swapURLClassLoader.ucpand broke WildFly).jdk.internal.loaderalone doesn't allow that swap, so adding it for every app JVM should be safe. This hasn't been tested on WildFly.fix(devloop): open the packages HotswapAgent needs in the app JVM (#2…
fix(devloop): open the packages HotswapAgent needs in the app JVM (va…