-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[GR-39200] XML schema related JDK classes not fully usable (JDK javax.xml.validation.Schema
and friends).
#4608
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
Hi @michael-simons, |
Sure, but sorry, no luck… see:
still fails:
|
Thanks for checking. We'll look into this soon. |
I just had a quick look at your change and while I don't know if those configuration affects how Graal native image is build itself or just the image and in which order the JDK of Graal is build… What does happen if you use the non-shaded name of Xerces? Anyway, thanks for sharing the commit (I find this educating) and also for looking into it. Curious what it will be in the end, the process seems to work for the other |
javax.xml.validation.Schema
and friends).javax.xml.validation.Schema
and friends).
@michael-simons I looked into this some more and came up with #4608. Can you give that a go and verify that this works for your example (it does on my machine:tm:)? I'm not sure why, but I didn't run into "2nd problem: Missing messages". |
Hello @fniephaus The latest dev build (10 days old, 20220606_2102) still fails. |
#4608 hasn't been merged yet so you'd need to build Native Image from source to try this out. If that's too much work on your end, you may need to wait until it's merged and deployed. Not sure if this can still make it into the upcoming 22.2 release. |
The fix should land in 22.3 and will be available shortly in a dev build. Please feel free to re-open if we didn't fix this :) |
Hey @fniephaus I am terribly sorry to get back to you only after the release of 22.2 Sadly, I have to report that it does not work in either 22.2 nor 22.3 dev. I tested
and
from two days ago. Image builds fine, but fails to run:
I have updated the zip (xmlschemaissue2.zip), I forgot to add above main file. So for reproducing please see: Download:
|
This comment was marked as outdated.
This comment was marked as outdated.
Apologies, I may have tested the fix with the wrong JDK, so thanks for checking again. I've opened #4770, which should resolve the issue. |
Could you please try again with a dev build in a couple of days? Thanks! |
Hello @fniephaus, I'm happy to confirm that both these dev builds work now as expected:
(From August 5th, I think). Thanks for taking care of maybe somewhat "exotic" use case these days. |
Yay! Thanks for confirming, glad it's working now :) |
Usecase
I want to use
javax.xml.validation.Schema
for loading XML Schema files, assigning them to ajavax.xml.parsers.DocumentBuilder
with the ultimate goal of loading and validating documents.This can be represented as such:
Together with a schema
and a document
Environment
I tested this under
With both 22.1.0
and 21.3.2
under Java 17.
I also tried various
--release
(8 and 11) switches to Javac before applyingnative-image
.So, the above program can be run with as a single class executable without issues:
java simons/Main.java schema.xsd document.xml
and printsmigration
.Compilation
(I have been using
-Ob
below to spare me a bit of time, issues applies both with and without quick mode).gives
1st problem: Missing classes
The following issues still seems to persist: #684 and #1387.
Running
main
producesThis can be fixed with
2nd problem: Missing messages
The generated image now works "better", but comes with that message after a recompilation:
which is really hard to understand, tbh.
This can be fixed with
Conclusion
The agent produces both files as expected:
and compilation with
produces a working image
My expectation however is that none of this is necessary, tbh or at least have a convenient switch like
--enable-https
but for xml, meaning "do the right thing".I settled for xml in my actual usecase because it's dependency and mostly hassle free use from Java and so I have a bit of expectation here on Graal, too :)
As usual, all files are attached (xmlschemaissue.zip), please ping me if there are more questions / remarks.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: