Repository navigation
Closed
Description
Description of the bug
Since upgrading to 24.5, when starting the application in debug mode with hotswap i get an endless stream of below log messages for various classes. On 24.4.x this is not happening. Is this a matter of silencing a log category or is this actually an issue? Using hotswap agent 2.0.0.
HOTSWAP AGENT: 13:37:33.332 ERROR (org.hotswap.agent.command.ReflectionCommand) - Error executin method onHotswap in class com.vaadin.flow.hotswap.Hotswapper
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.hotswap.agent.command.ReflectionCommand.doExecuteReflectionCommand(ReflectionCommand.java:207)
at org.hotswap.agent.command.ReflectionCommand.executeCommand(ReflectionCommand.java:168)
at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:43)
Caused by: java.lang.NoClassDefFoundError: javax/enterprise/util/AnnotationLiteral
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:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at com.vaadin.flow.hotswap.Hotswapper.resolveClass(Hotswapper.java:459)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.vaadin.flow.hotswap.Hotswapper.onHotswap(Hotswapper.java:148)
... 6 more
Caused by: java.lang.ClassNotFoundException: javax.enterprise.util.AnnotationLiteral
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
Expected behavior
No error messages
Minimal reproducible example
Use latest hotswap agent and start project in debug mode like usual.
Versions
Vaadin 24.5.2
Reacted by Artjom Jakovlev and Jonas Tonndorf-Martini
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fields✅ Closed
Activity
mcollovati commentedon Oct 31, 2024
It looks like Hotswap is notifying Flow about classes that are not available in its class loader.
Definitely,
javax/enterprise/util/AnnotationLiteralis incompatible with Vaadin 24, being onjavaxnamespace.I don't have idea where the agent is getting information about that classes, but at least you can restrict the Vaadin plugin to only react to changes in application classes by setting the
vaadin.watched-packagesinagent.propertiesfile.mcollovati commentedon Oct 31, 2024
Anyway, such errors do not affect the application or the hotswap capabilities.
mcollovati commentedon Oct 31, 2024
Documentation for
vaadin.watched-packagesis missing from the docsjorgheymans commentedon Oct 31, 2024
Indeed, setting
vaadin.watched-packagesto my root application package insrc/main/resources/hotswap-agent.propertiesmakes the problem go away. Agreed that it does not affect the workings, but this is a mandatory setting then as the log flood is rather huge. Note i tested it on a basic Vaadin starter and there it does not happen¯\_(ツ)_/¯mcollovati commentedon Oct 31, 2024
I wonder where the javax artifact comes from
jorgheymans commentedon Nov 1, 2024
It's continuously logging the stacktrace but only for below 4 classes:
None of these are a dependency in my project so it's really strange.
mshabarov commentedon Nov 5, 2024
Could you please provide the dependency tree of your project?
mvn dependency:treejorgheymans commentedon Nov 5, 2024
tree.txt
jorgheymans commentedon Nov 5, 2024
Maybe the hotswap agent itself has these dependencies via the plugin mechanism ?
jonas-tm commentedon Nov 13, 2024
I am having the same issue when upgrading from 24.4 to 24.5
Vaadin 24.5.4
Spring Boot 3.3.5
Jetbrains JDK 21 with Hotswap installed
-XX:+AllowEnhancedClassRedefinition -XX:HotswapAgent=fatjar7 remaining items
chore: document hotswap plugin watched-packages setting
fix: prevent hotswap failure if class is not found
fix: prevent hotswap failure if class is not found (#20549)
fix: prevent hotswap failure if class is not found (#20549)
fix: prevent hotswap failure if class is not found (#20549)
fix: prevent hotswap failure if class is not found (#20549) (#20557)
fix: prevent hotswap failure if class is not found (#20549) (#20556)
chore: document hotswap plugin watched-packages setting (#3916)
totally-not-ai commentedon Sep 30, 2026
Fixed by #20549 (Vaadin 24.7):
Hotswappernow handlesNoClassDefFoundErrorfor classes it can't load and logs it only at debug level, so the error flood no longer appears. Limitingvaadin.watched-packagesto your application packages is documented as well. Closing.