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

Allow to define parent first artifacts in fast jar mode #17392

Merged

Conversation

essobedo
Copy link
Contributor

@essobedo essobedo commented May 20, 2021

fixes #17391

Motivation

In case a dependency of the application contains classes that are part of the JDK, we can end up with LinkageError. This is typically what happens when we have a dependency that contains the class javax.xml.namespace.QName, because this class is still part of the JDK.

The official workaround is to define the artifact with quarkus.class-loading.parent-first-artifacts but it is ignored in fast jar mode.

Modifications

  • Relies on ClassLoadingConfig to extract the parent first artifacts that are defined by the enduser to build a collection of artifact keys to define as parent first artifacts in the model.
  • Adds an integration test to ensure that it works as expected in build mode whatever the target packing type
  • Adds an integration test to ensure that it works as expected in dev mode

@essobedo
Copy link
Contributor Author

@stuartwdouglas it is the PR for the problem that I described here. WDYT of it?

@quarkus-bot
Copy link

quarkus-bot bot commented May 20, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 32d5711

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@famod
Copy link
Member

famod commented May 20, 2021

@essobedo CI says there is a formatting issue. Please check/fix.

@essobedo essobedo force-pushed the classloading-parent-first-fast-jar branch from 32d5711 to 0d900a7 Compare May 20, 2021 19:35
@essobedo
Copy link
Contributor Author

@essobedo CI says there is a formatting issue. Please check/fix.

@famod Fixed, thx

@essobedo essobedo force-pushed the classloading-parent-first-fast-jar branch from 0d900a7 to 8aeea2a Compare May 20, 2021 19:42
@quarkus-bot
Copy link

quarkus-bot bot commented May 20, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 0d900a7

⚠️ Artifacts of the workflow run were not available thus the report misses some details.

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented May 20, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 8aeea2a

Status Name Step Test failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
✔️ JVM Tests - JDK 16
MicroProfile TCKs Tests Verify Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 Windows #

📦 extensions/grpc/deployment

io.quarkus.grpc.server.scaling.SingleGrpcVerticleTest. - More details - Source on GitHub

📦 extensions/resteasy-reactive/jaxrs-client-reactive/deployment

io.quarkus.jaxrs.client.reactive.deployment.test.UniInvokerTestCase.testInjection line 48 - More details - Source on GitHub


⚙️ MicroProfile TCKs Tests #

📦 tcks/microprofile-config

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesDefaultOnBean line 172 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesNoPrefixOnBean line 149 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesNoPrefixOnBeanThenSupplyPrefix line 156 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesPlainInjection line 106 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesWithPrefix line 115 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testConfigPropertiesWithoutPrefix line 132 - More details - Source on GitHub

org.eclipse.microprofile.config.tck.ConfigPropertiesTest.testNoConfigPropertiesAnnotationInjection line 165 - More details - Source on GitHub

Copy link
Member

@stuartwdouglas stuartwdouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. With our internal parent first stuff we differentiate between dev/test and prod, but I don't think it really matters here because you can control it via profiles.

@quarkus-bot
Copy link

quarkus-bot bot commented May 21, 2021

Failing Jobs - Building 8aeea2a

Status Name Step Test failures Logs Raw logs
Maven Tests - JDK 11 Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ Maven Tests - JDK 11 #

📦 integration-tests/maven

io.quarkus.maven.it.DevMojoIT.testThatNewResourcesAreServed line 849 - More details - Source on GitHub

@stuartwdouglas stuartwdouglas merged commit 9245ad3 into quarkusio:main May 21, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 21, 2021
@stuartwdouglas
Copy link
Member

Thanks for the patch

@essobedo essobedo deleted the classloading-parent-first-fast-jar branch May 21, 2021 04:24
@essobedo
Copy link
Contributor Author

@stuartwdouglas Thx for reviewing and merging it, do you want a backport for the branch 1.13?

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

Successfully merging this pull request may close these issues.

Cannot load artifacts in parent first manner in fast jar mode
3 participants