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

log4j-core and log4j-api version constraint specified in io.quarkus:quarkus-bom does not match #35428

Closed
cuichenli opened this issue Aug 21, 2023 · 2 comments · Fixed by #35449
Labels
area/core kind/bug Something isn't working
Milestone

Comments

@cuichenli
Copy link
Contributor

cuichenli commented Aug 21, 2023

Describe the bug

Since version 3.0.1.Final, the io.quarkus:quarkus-bom package introduced a constraint on log4j-core and specified the version as 2.17.1. However, the version constraint for log4j-api remains at 2.20.0. It is unclear whether this was intentional, but it has led to a tricky bug during development (at least in my case, it was not easy to identify the root cause). You can find a reproducible repository at https://github.com/cuichenli/quarkus-log4j-core-constraint-issue.

When you run the program in this repo, you will see error:

Caused by: java.lang.NoSuchMethodError: 'java.lang.ClassLoader[] org.apache.logging.log4j.util.LoaderUtil.getClassLoaders()'

I have observed that when using io.quarkus.platform:quarkus-bom, this issue does not occur. Therefore, I'm curious about the scenarios in which we should use either the quarkus-bom package or the quarkus-platform:quarkus-bom package. Could you provide some guidance on this matter? Thank you!

@cuichenli cuichenli added the kind/bug Something isn't working label Aug 21, 2023
@geoand
Copy link
Contributor

geoand commented Aug 21, 2023

cc @aloubyansky @gsmet

@aloubyansky
Copy link
Member

The core a appears to be a test scoped dependency constraint in the io.quarkus:quarkus-bom which gets filtered out from the io.quarkus.platform:quarkus-bom

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.17.1</version>
    <scope>test</scope>
</dependency>

We are not actually managing log4j-core directly in the quarkus-bom, it's probably getting leaked from some other BOM we import but it makes sense to align them.

As to the io.quarkus vs io.quarkus.platform, it's the later one that we officially recommend Quarkus applications to use.

Thanks for reporting the issue @cuichenli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants