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

Exception from Hotswapper #2910

Open
Artur- opened this issue Nov 19, 2024 · 2 comments
Open

Exception from Hotswapper #2910

Artur- opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something isn't working hilla Issues related to Hilla

Comments

@Artur-
Copy link
Member

Artur- commented Nov 19, 2024

Describe the bug

In a Copilot test, we see the following on startup

HOTSWAP AGENT: 07:39:01.830 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.GeneratedMethodAccessor32.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	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.UnsatisfiedLinkError: Unable to load library 'Carbon':
libCarbon.so: cannot open shared object file: No such file or directory
libCarbon.so: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libCarbon.so) not found in resource path
...
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:325)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:481)
	at com.sun.jna.Library$Handler.<init>(Library.java:197)
	at com.sun.jna.Native.loadLibrary(Native.java:668)
	at com.sun.jna.Native.loadLibrary(Native.java:652)
	at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:20)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at com.vaadin.hilla.Hotswapper.affectsEndpoints(Hotswapper.java:127)
	at com.vaadin.hilla.Hotswapper.onHotswap(Hotswapper.java:49)
	at com.vaadin.hilla.Hotswapper.onClassLoadEvent(Hotswapper.java:27)
	at com.vaadin.flow.hotswap.Hotswapper.onHotswapInternal(Hotswapper.java:236)
	at com.vaadin.flow.hotswap.Hotswapper.onHotswap(Hotswapper.java:145)
	... 6 more
	Suppressed: java.lang.UnsatisfiedLinkError: libCarbon.so: cannot open shared object file: No such file or directory
		at com.sun.jna.Native.open(Native Method)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:213)
		... 18 more
	Suppressed: java.lang.UnsatisfiedLinkError: libCarbon.so: cannot open shared object file: No such file or directory
		at com.sun.jna.Native.open(Native Method)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:226)
		... 18 more
	Suppressed: java.io.IOException: Native library (linux-x86-64/libCarbon.so) not found in resource path ...
		at com.sun.jna.Native.extractFromResourcePath(Native.java:1141)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:297)
		... 18 more

This seems to originate in

Class<?> cls = Class.forName(changedClass);
where Hilla tries to load all classes that are reported by HotswapAgent

Expected-behavior

No exceptions

Reproduction

Use io.methvin.watcher.DirectoryWatcher in the app and run it on linux or windows

System Info

Vaadin 24.6 alpha3

@Artur- Artur- added bug Something isn't working hilla Issues related to Hilla labels Nov 19, 2024
@platosha
Copy link
Contributor

Is this a problem in Hilla or in the Copilot tests setup? I don't understand why it lists a macOS library CarbonAPI under linux platform.

@platosha
Copy link
Contributor

We could probably make the error less verbose here. I don't think it would make user experience worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

2 participants