-
Notifications
You must be signed in to change notification settings - Fork 197
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
Stop depending on ASF Xalan #4065
Comments
I recall that the provided transformer factory had issues for which it was not possible to leverage java code generation hence the need to bring that dependency. I don't recall the issue in detail but there were an issue with the generated classes names. It may have been fixed. |
@lburgazzoli I removed |
good to know, so things have been fixed finally :) |
Ci build failed (in
@lburgazzoli It seems to be the issue mentioned by you in your previous comment. Unfortunately I did't run locally this extension tests ( |
I don't understand a lot of the code behind the xslt, but I found this commit 1348a08#diff-3f81d95136449165870ef59323dfe2d77527e7ff78ba506f4a81b404d608611f which seems to be doing the required functionality with the xalan library. I debugged a little bit the same processes with jdk library. I made the @ppalaga @lburgazzoli I just wanted to share this. I might be missing something, but from the debugging it seems like there is a placeholder, which is replaced by the real value, but it does't work correctly. If my observation is correct, then it explains why there is a ClassNotFoundException. If the behavior could be changed to generate a correct name, then it might be working correctly. |
I don't recall all the details but that is pretty much where I stopped and I switched to xalan, I think I were able to get down to the real issue but it's been long time. I recall that there where a bad handling of |
I guess we need to open an openjdk bug or stay with xalan |
Therefore it might not be possible to remove xalan. EDITED: I'm going to fix |
Nice investigating! The And when generating the translet class, |
I just test with zhfeng/jdk11u-dev@7e6cad7 locally and it works. Is there any way we can do to fix in upstream openjdk? |
Great news! My locally built java did not work successfully with this problem, but I probably miss-configured something. EDITED: Fix works, I verified it. |
@galderz any hint how to proceed? |
Thanks @galderz and I'm trying to create a simple reproducer of this issue. Btw, https://bugs.openjdk.org/ is the right place to report? |
@zhfeng Yeah that's the right place. |
@galderz But it needs login to create a issue, I have no such credential unfortunately. |
@zhfeng Ah yes. Could you please write up a bug report here? I can then ask someone to verify it and we can create the OpenJDK issue as well as help with proposing a fix. |
@galderz I just revisit this issue and write a simple reproducer https://github.com/zhfeng/jdk-xalan-issue-reproducer. Can you take a look? |
Thanks @zhfeng for the reproducer. I'll have a look. |
@zhfeng Thanks a lot for building the reproducer. It worked for me. I also checked the proposed fix and it looks good to me but I'm in no way an expert in this area. Both At this stage, you can do either of two things: you could first ask in the I would also recommend that you run the tier1 tests as well as the jaxp/xml tests (they are not part of tier1). You can run these extra tests via the |
Thanks @galderz I will run these tests at first. |
Out of curiosity, I was able to work around this issue by transforming the XSLT generated classes to update the incorrect class & package names. I got the XSLT JVM and native tests passing without the The downside is that you need some additional |
@jamesnetherton it seems good. |
Runtime unfortunately 😞
I'll try to polish it up today and link to my branch. |
Here's a branch with a rough POC: https://github.com/jamesnetherton/camel-quarkus/tree/xalan-remove Not sure if a lot of the stuff in the |
Thanks @jamesnetherton ! I'm wonder why we need |
I think so, because the XSLTC generated classes refer to internal bits from |
Hi! |
@turing85 Unfortunately the fix of XALANJ-2664 had not been included in |
Does anybody remember, what is different in Xalan, that the setting of the translet class name/package works there? |
ASF Xalan does not initialize |
yeah, so the classname would be without package, see https://github.com/apache/xalan-java/blob/master/xalan/src/main/java/org/apache/xalan/xsltc/compiler/XSLTC.java#L547-L556 But in the JDK, the default value of packageName is I had https://github.com/zhfeng/jdk-xalan-issue-reproducer before. |
I wrote down this report for OpenJDK. Could you guys please review it before we submit it? ---->8-----
|
Thanks @ppalaga - It looks good to me! So what is the next step? can we put the fix to the upstream jdk? |
I have added solution C. Which is IMO the proper solution, but I am not sure how much bug-backwards-compatible the JDK aims to be. I guess, we should report the issue on [email protected] and maybe discuss the solution there, before sending a PR? WDYT @galderz? |
@galderz I wonder how much is |
The fix has been included openjdk/jdk@3989a19 |
That's a phenomenal news! Thanks @zhfeng @galderz and anybody else involded! @galderz can you see any chance that the fix gets backported to JDK 21 and 17? Can we help somehow for it to happen? |
@ppalaga I'll ask around and see what can be done |
@ppalaga I asked around and the best approach would be to backport it first to JDK 24 then to JDK 21. I doubt it'll get backported to JDK 17 but if you really need that you'd have to explain why specifically. |
I will take care of the JDK 24 and 21 backports |
FYI JDK 24 backport: openjdk/jdk24u#73 Once that goes through I'll send the one for JDK 21 |
Having it in 21 will be awesome, thanks a lot!
The whole Quarkiverse is on Java baseline 17 currently. Not sure it is going to change to 21 any time soon. I asked about that on Quarkus Zulip Max replied, that Quarkus 3.x's baseline is going to stay Java 17. |
It's unclear to me in this issue and I'm not familiar how this is being used, but could you when this xlt gets generated and therefore needs the fix? Is it during native image execution (e.g. something that gets generated via some kind of build time initialization that runs inside the native image JDK), or is it by Quarkus build before native image gets invoked (e.g. the JDK that compiles the source code and runs maven/gradle)? Or some other phase? |
JDK 24 backport has gone in, it'll be part in 24.0.2 (July). |
JDK 21 backport PR: openjdk/jdk21u-dev#1412 |
We generate the translet class during Quarkus build phase (where only the standard JDK is involved). During that process we create a mapping from XLST URIs to translet FQ class names. That's where the unique and predictable name under which So there is no problem with native image generation or runtime. The only problem we have is with the vanilla JDK not storing the generated translet classes where we want it to. |
I've had a chat with the team and JDK 17 is pretty much done and only very critical fixes get backported there. For the time being we will backport it to JDK 21 and we can reevaluate again, if necessary, once the backport there has had some time running in production for end users. |
Follows https://issues.apache.org/jira/browse/CAMEL-18346
Xalan is directly used in
camel-quarkus-support-xalan
. It should be possible to remove xalan dependency and use java support instead.The text was updated successfully, but these errors were encountered: