You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vaadin-copilot is in the classpath even when the production classpath is used.
After creating a native build as described in the vaadin docs (mvn -Pproduction -Pnative native:compile), missing reflection configuration and copilot being on the classpath causes an exception in SpringBridge.call.
This can be prevented by excluding vaadin copilot in the production profile as per the edit in this gist. The gist also contains the logfiles with complete stacktraces.
After doing this and building another native build, this also fails with the following exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of 'com.vaadin.hilla.route.records.ClientViewConfig': cannot deserialize from Object value (no delegate- or property-based Creator): this appears to be a native image, in which case you may need to configure reflection for the class that is to be deserialized
at [Source: (ByteArrayInputStream); line: 1, column: 3] (through reference chain: java.util.ArrayList[0])
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1915) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:414) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1355) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1431) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:352) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:359) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4825) ~[my-app.exe:2.15.4]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3817) ~[my-app.exe:2.15.4]
at com.vaadin.hilla.route.ClientRouteRegistry.registerClientRoutes(ClientRouteRegistry.java:158) ~[my-app.exe:na]
at com.vaadin.hilla.startup.RouteUnifyingServiceInitListener.serviceInit(RouteUnifyingServiceInitListener.java:89) ~[my-app.exe:na]
at com.vaadin.flow.server.VaadinService.lambda$init$0(VaadinService.java:236) ~[my-app.exe:24.4.0.alpha30]
So hilla is missing reflection information that is essential for graalvm native builds to work as intended.
Expected-behavior
Native builds should work without issue if no external dependencies are used.
I also encountered issues with hibernate-spatial and native builds but that is of course not caused by vaadin.
Reproduction
Download this starter app with flow and hilla views.
Run the application once normally (sping-boot:run) to check if everything is working.
Create a production build.
Run it and see it fail (this causes log1.txt - see gist)
Change the pom.xml (add an exclusion for vaadin-copilot in the production profile - see gist)
Add a @Menu() annotation to EmptyView
Add vaadin.expose-server-routes-to-client=true to the application.properties file to enable @Menu
Run it again normally to see both views in the side navigation
Create a production build.
Run it an see it fail (log2.txt in the gist)
System Info
JDK (output of java --version):
java 21.0.3 2024-04-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.3+7.1 (build 21.0.3+7-LTS-jvmci-23.1-b37)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.3+7.1 (build 21.0.3+7-LTS-jvmci-23.1-b37, mixed mode, sharing)
Vaadin:
24.4.0.alpha23
OS:
Windows 11 Pro Version 23H2 (Build 22631.3447)
The text was updated successfully, but these errors were encountered:
Describe the bug
vaadin-copilot
is in the classpath even when the production classpath is used.After creating a native build as described in the vaadin docs (
mvn -Pproduction -Pnative native:compile
), missing reflection configuration and copilot being on the classpath causes an exception in SpringBridge.call.This can be prevented by excluding vaadin copilot in the production profile as per the edit in this gist. The gist also contains the logfiles with complete stacktraces.
After doing this and building another native build, this also fails with the following exception:
So hilla is missing reflection information that is essential for graalvm native builds to work as intended.
Expected-behavior
Native builds should work without issue if no external dependencies are used.
I also encountered issues with hibernate-spatial and native builds but that is of course not caused by vaadin.
Reproduction
sping-boot:run
) to check if everything is working.@Menu()
annotation toEmptyView
vaadin.expose-server-routes-to-client=true
to theapplication.properties
file to enable@Menu
System Info
JDK (output of
java --version
):java 21.0.3 2024-04-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.3+7.1 (build 21.0.3+7-LTS-jvmci-23.1-b37)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.3+7.1 (build 21.0.3+7-LTS-jvmci-23.1-b37, mixed mode, sharing)
Vaadin:
24.4.0.alpha23
OS:
Windows 11 Pro Version 23H2 (Build 22631.3447)
The text was updated successfully, but these errors were encountered: