flow icon indicating copy to clipboard operation
flow copied to clipboard

Runtime exception every time classes are reloaded

Open jojule opened this issue 1 year ago • 2 comments

Description of the bug

Every time hot-reload is triggered, I get the following exception:

HOTSWAP AGENT: 18:35:40.711 WARNING (org.hotswap.agent.watch.nio.WatcherNIO2) - Watcher on /Users/phoenix/Downloads/my-app/target/classes/com/example/application/services not valid, removing path=
HOTSWAP AGENT: 18:35:41.027 INFO (org.hotswap.agent.plugin.spring.reload.SpringBeanReload) - try to add changed property 'file:/Users/phoenix/Downloads/my-app/target/classes/application.properties' into org.springframework.beans.factory.support.DefaultListableBeanFactory@7048535f
HOTSWAP AGENT: 18:35:41.709 INFO (org.hotswap.agent.plugin.jackson.JacksonPlugin) - Reloaded Jackson.
HOTSWAP AGENT: 18:35:42.540 RELOAD (org.hotswap.agent.plugin.spring.reload.SpringBeanReload) - the properties of 'org.springframework.beans.factory.support.DefaultListableBeanFactory@7048535f' is changed
HOTSWAP AGENT: 18:35:42.548 ERROR (org.hotswap.agent.plugin.spring.reload.XmlsChangedCommand) - Error invoking method
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.hotswap.agent.plugin.spring.reload.SpringChangedReloadCommand.executeCommand(SpringChangedReloadCommand.java:54)
	at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:43)
}}${_p9k__e::=${${_p9k__1ldir+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}1}}}+}${${_p9k__e:#00}:+${${_p9k_t[$_p9k__n]/<_p9k__ss>/$_p9k__ss}/<_p9k__s>/$_p9k__s}${_p9k__v}${${(M)_p9k__e:#11}:+ }${_p9k__c}%b%K{234\}%F{031\} ${${:-${_p9k__s::=%F{234\}}${_p9k__ss::=%242F}${_p9k__sss::=%F{234\}}${_p9k__i::=2}${_p9k__bg::=234}}+}}${(e)_p9k__vcs}%b%k$_p9k__sss%b%k%f${:-" %b%k%f"}}}}+}${(e)_p9k_t[6]}${${_p9k__h::=95.5}+}${${_p9k__d::=$((_p9k__m-_p9k__h))}+}${_p9k__lprompt/\%\{d\%\}*\%\{d\%\}/${_p9k__1ldir-${:-"%B%F{039}"}${(Q)${:-"\\~"}}${:-"%b%K{234}%F{031}"}/${${${_p9k__d:#-*}:+Downloads}:-${:-"%F{103}"}Dow${:-"%b%K{234}%F{031}"}${$((_p9k__d+=6))+}}/${:-"%B%F{039}"}my-app${:-"%b%K{234}%F{031}"}}}${${_p9k__m::=$((_p9k__d+_p9k__h))}+}}${${COLUMNS::=$_p9k__clm}+}"
	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180)
	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
	at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239)
	at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
	at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:230)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:80)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:61)
	at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:552)
	at org.hotswap.agent.plugin.spring.files.PropertyReload.getPropertyOfPropertySource(PropertyReload.java:77)
	at org.hotswap.agent.plugin.spring.files.PropertyReload.reloadPropertySource(PropertyReload.java:60)
	at org.hotswap.agent.plugin.spring.reload.SpringBeanReload.refreshProperties(SpringBeanReload.java:385)
	at org.hotswap.agent.plugin.spring.reload.SpringBeanReload.doReload(SpringBeanReload.java:277)
	at org.hotswap.agent.plugin.spring.reload.SpringBeanReload.reload(SpringBeanReload.java:259)
	at org.hotswap.agent.plugin.spring.reload.SpringChangedAgent.doReload(SpringChangedAgent.java:204)
	at org.hotswap.agent.plugin.spring.reload.SpringChangedAgent.reloadAll(SpringChangedAgent.java:192)
	at org.hotswap.agent.plugin.spring.reload.SpringChangedAgent.reload(SpringChangedAgent.java:143)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 3 more

Expected behavior

There should be no exception.

Minimal reproducible example

Minimal Hello World application from start.vaadin.com with two views: One for Hilla and for Flow

Versions

Hilla: 24.5.0.alpha15 Flow: 24.5.0.alpha20 Vaadin: 24.5.0.alpha17 Copilot: 24.5.0.alpha20 Frontend Hotswap: Enabled, using Vite OS: aarch64 Mac OS X 15.0 Java: JetBrains s.r.o. 21.0.3 Browser: Chrome 128.0.6613.138 (Official Build) (arm64) Java Hotswap: false IDE Plugin: 1.3.1 IDE: IntelliJ 2024.2

jojule avatar Sep 18 '24 01:09 jojule

It looks like an issue in the Spring hotswap plugin. Do you have the full stacktrace reporting the original cause of the exception? Perhaps the plugin is calling some Spring API that has been changed

mcollovati avatar Sep 18 '24 05:09 mcollovati

Cannot reproduce with the given instructions

Artur- avatar Sep 19 '24 10:09 Artur-