-
Notifications
You must be signed in to change notification settings - Fork 167
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
Hilla app with @PWA annotation fails when running as native compiled image on macOS #19497
Comments
#19457 should fix the issue, but it is not yet released. |
Thank you for the reference @mcollovati. I'll give it a try. |
I forked
After that, I created the native image again:
And then started it again:
Now there is another error:
|
The fix is in the vaadin-spring artifact |
BTW, there should also be a first alpha for Vaadin 24.5 that you can try without having to build flow locally |
Also, if you are want to build flow locally but use Vaadin platform 24.4, maybe better build from the 24.4 branch instead of main |
Alright, obviously I was on the wrong path 😅 Thanks for your advice, you seem to know your repos, modules, artefacts and versions 👍 I'll give it another try later. |
Ok, next try with
Error:
|
That's weird. I tried it and it worked for me |
I tested with GraalVM CE 21 and 22, and the native executable works fine with both. No errors at runtime and the application is working. I'm on Linux, I don't know if that makes a difference. |
oracle/graal#4124 could be related |
I tried again after a reboot and without any other interfering processes, but the error remains. I'll try it on Linux within the next days. |
I can confirm, that I don't get the described errors, when I create the native executable using Linux. I leave it to you @mcollovati to close this ticket or leave it open. Thank you, for your help on this 🫶 |
Thanks for testing. |
There is one more thing I noticed, and I don't understand: Let's say I managed to create a native executable using Linux like described above. The next step would be to create a Docker image using this native executable. A simple Dockerfile could look like this:
Creating a Docker image from this Dockerfile works as expected:
Now, I'd like to start a new Docker container using this Docker image:
From the console output, I can see that the app has been started. When I try to access the app in the browser, I'm getting the same Why is that? Why do I get this error messages? I'm running a native executable inside a Docker container. Why is this native executable complaining about the missing AWT in |
I am not completely sure, and I can't check right now, but probably the executable is dinamically linked, so the required libraries should be present at runtime (there should be some library file in the target directory). |
Yes, you are right 😄 There are a couple of library files (
... everything works fine! The Docker image is created as desired and when I start a Docker container from that image I can access the Hilla PWA without errors 🙌 |
Would the correct fix here be to produce the images at production build time and not have a dependency on awt? |
Describe the bug
A Hilla app with
@PWA
annotation throws an exception when running as native compiled image:Expected-behavior
A Hilla app with
@PWA
annotation should not throw unexpected exceptions when running as native compiled image.Reproduction
Create a new Hilla project:
Add
@PWA(name = "Hilla PWA", shortName = "PWA")
tosrc/main/java/com/example/application/Application.java
.Compile Hilla app to native image:
Run Hilla app as native compiled image:
System Info
Hilla: 24.4.0.beta5
Hilla CLI: 2.0.1
Java: 21.0.2 (OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 - build 21.0.2+13-jvmci-23.1-b30)
OS: macOS Sonoma 14.4.1 (23E224)
The text was updated successfully, but these errors were encountered: