-
Notifications
You must be signed in to change notification settings - Fork 1.2k
H2 1.4.200 does not work with native-image@graalvm whereas 1.4.199 works #2207
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
Comments
There were no significant changes in that area, but H2 uses reflection in a few places in both these versions. Actually 1.4.200 uses less amount of reflective calls. Please, report bugs and limitations of that tool to its developers. |
And you need to check your configuration first, maybe you need to upgrade it for a new version of H2. |
I took a look on Native Image Java Limitations section in its documentation and I think it isn't ready yet for H2. It may work somehow, but we don't have a time to support that tool in its current status. |
Hmm, why 199 was working then? I activated reflection and resources as needed by h2 and this part is fine. |
I have no idea how and why older version works. Maybe you need to include more classes to your configuration for 1.4.200. And because H2 1.4.201 will be Java 8 based, most likely it also will be even less compatible with native images until they will be improved to support more basic features of JVM. This is a bugtracker of H2. Your issue is not a bug of H2, we don't support that tool. If you need some help, please use our mailing list, StackOverflow, or some other resource for your questions. |
Hmm, what is the issue with java 8? Graal is based on java 8 and next release will support java 11 so not an issue with graal currently. |
Native images don't properly support invokedynamic from Java 7 (not widely used before Java 8) and method handles; only a limited subset of them is somehow supported. Other limitations also exist. You should consider native images as an experimental feature that could be suitable for projects specially designed for it, but not as something that will always work with third-party projects, especially with complex ones. |
I do consider it as specific to a deployment but it is no more experimental and officially supported for prod. It is also required in several cloud/k8s cases - to reduce boot times and memory usages - so it is good to be able to use h2 IMHO. What about reporting issues you have to be friendly with native-image on graal bugtracker referencing this issue? They are quick good at fixing things and I dont see why h2 would not be able to run whereas quarkus made most of jboss ecosystem running. |
@rmannibucau you are welcome to debug this issue and report stuff to Graal. However, I am sorry, but no-one here is interested in doing that, and we do not consider Graal a supported feature. |
FYI I put a sample on github https://github.com/rmannibucau/h2graal Thanks guys. |
+1 interesed, to use in embeded in a desktop app, compiled with graalvm. Any alternatives if H2 is not gonna be suitable? |
Maybe the error has a early solution oracle/graal#3028 |
Hi,
A quick issue to report that 1.4.199 works well with graalvm native-image tool (to compile natively an application using h2, I am using this script with graal 19.2.1 - to illustrate how it works:
Side note: config.json files can be generated with the graal agent if needed, it is mainly the reflection needed by h2 and the data.zip file inclusion, nothing crazy.
Now, if I switch to 1.4.200 I can't go native anymore cause a lot of h2 classes are initialized at build time due to Driver enforced initialization. I didn't investigate but it sounds like some more static initializations are done - even transitively - which prevents native-image to works correctly with this setup.
Can you ensure h2 is native-isable for future versions please?
Romain
The text was updated successfully, but these errors were encountered: