Skip to content
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

Wrong service file loaded in native mode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0 #1078

Closed
ppalaga opened this issue Oct 24, 2023 · 12 comments
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Oct 24, 2023

Before the upgrade the service loader has loaded the resource META-INF/services/org.apache.cxf.bus.factory from the application runner quarkus-cxf-integration-test-mtom-awt-2.5.0-SNAPSHOT-runner.jar but now after the Mandrel upgrade, the resource is loaded from a dependency org.apache.cxf:cxf-core.

@ppalaga
Copy link
Contributor Author

ppalaga commented Oct 24, 2023

@zakkak @galderz is there any way to get back to the old behavior (which is BTW consistent with the JVM mode)?

ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Oct 24, 2023
…ode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Oct 25, 2023
…ode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Oct 25, 2023
…ode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
ppalaga added a commit that referenced this issue Oct 25, 2023
…pgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
@zakkak
Copy link

zakkak commented Oct 25, 2023

@ppalaga can you please provide a reproducer? It sounds like a GraalVM bug to me, but would need to have a look at it first.

@ppalaga
Copy link
Contributor Author

ppalaga commented Oct 25, 2023

Here is how to reproduce:

git clone git@github.com:quarkiverse/quarkus-cxf.git
cd quarkus-cxf
# the commit that upgrades to Quarkus 3.5.0
# there is a workaround in the main branch right after it, 
# so being at this particular commit is important
git reset --hard fea5378251d6aa98f6dad12dbbf4dc796d303e74
# build the whole source tree
mvn clean install -DskipTests -Dquarkus.build.skip -Denforcer.skip
# run some native test
cd integration-tests/mtom-awt
mvn clean verify -Pnative -Dquarkus.native.container-build
...
[ERROR]   MtomAwtIT>MtomAwtTest.uploadDownloadMtom

The root cause is that org.apache.cxf.BusFactory.getBusFactoryClass(ClassLoader) sees the default META-INF/services/org.apache.cxf.bus.factory from cxf-core rather than the one that we write into the application at build time (implemented around here )
And so the BusFactory loads the default implementation instead of our custom io.quarkiverse.cxf.QuarkusBusFactory

@zakkak
Copy link

zakkak commented Oct 26, 2023

The issue is introduced by oracle/graal@d5000f4 I will have a better look probably next week.

@olpaw FYI

@maxandersen
Copy link
Member

This feels like a native image bug if not possible to have similar semantics as jvm?

@zakkak
Copy link

zakkak commented Oct 26, 2023

Correct

@zakkak
Copy link

zakkak commented Oct 26, 2023

The issue is introduced by oracle/graal@d5000f4 I will have a better look probably next week.

@olpaw FYI

Wrong mention... Sorry Paul. cc @chumer

@zakkak
Copy link

zakkak commented Oct 26, 2023

Upstream Graal fix: oracle/graal#7678

ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Nov 22, 2023
…ode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
ppalaga added a commit that referenced this issue Nov 22, 2023
…pgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
@zakkak
Copy link

zakkak commented Dec 5, 2023

The upstream fix has been merged and should land in GraalVM for JDK 22 and Mandrel 24.0. A backport request is pending to get the fix in GraalVM for JDK 17 and Mandrel 23.1 as well.

@ppalaga
Copy link
Contributor Author

ppalaga commented Dec 5, 2023

Thanks a lot, @zakkak!

@ppalaga
Copy link
Contributor Author

ppalaga commented Dec 22, 2023

I am closing this leaving the workaround in place.

@ppalaga ppalaga closed this as completed Dec 22, 2023
@ppalaga ppalaga added this to the 2.5.0 milestone Dec 22, 2023
@zakkak
Copy link

zakkak commented Dec 22, 2023

The upstream fix has been merged and should land in GraalVM for JDK 22 and Mandrel 24.0. A backport request is pending to get the fix oracle/graal#7957 (comment) and graalvm/mandrel#629.

FTR the upstream fix will land in land in GraalVM for JDK 21 and Mandrel 23.1 in the upcoming January CPU releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants