-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ClassNotFoundException when injecting REST client in native #20896
Comments
I can fix the problem by ignoring the 'commons-logging' dependency in the REST client dependency manually: implementation ('io.quarkus:quarkus-rest-client') {
exclude group: 'commons-logging', module: 'commons-logging'
} |
@andlinger please attach a simple reproducer |
Same problem since Quarkus 2.3.0. |
when I use java 11 and graal 21.2 with a docker image (the default build option if you do the build without graal installed locally) with maven, the native binary works for me. How do you run with graalvm 21.3, is there a way to do it with docker/podman instead of a local graalvm installation? |
It looks like gradle for some reason doesn't honor the exclusion of commons-logging. For gradle the relevant part of the dependency tree is:
The dependency is excluded in Quarkus: https://github.com/quarkusio/quarkus/blob/2.3.1.Final/extensions/apache-httpclient/runtime/pom.xml#L20-L29 (and Maven honors this if we do a Maven project). |
@aloubyansky @gsmet do you maybe know why this happens? |
@glefloch is this expected that the exclusion configured in the BOM is ignored in this case? |
Yes, dependency exclusion does not work in the same way on gradle. If you want to know which module imports
It looks like we have something like:
As one module ( |
I noticed that commons-logging (apache) dependecy was already in classpath since 1.x versions. ps: This sad issue is preventing a whole app upgrade to quarkus 2.x. |
Hi @vhmolinar, this issue didn't occur with Quarkus 2.1.4.Final. |
A workaround to "fix" this issue is exclusion of commons-logging in build.gradle for :
|
@vhmolinar Even though the fix is similar, it should be a different issue, not this one reopened, IMO. |
@michalszynkiewicz thanks for asking me. I managed to do my first direct contribution #21627 |
Describe the bug
When I inject the Resteasy REST client a ClassNotFoundException occurs. But this only happens in a native app.
Expected behavior
No response
Actual behavior
The injection fails with the following exception:
How to Reproduce?
No response
Output of
uname -a
orver
Darwin Kernel Version 20.6.0
Output of
java -version
openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
21.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 7.2 ------------------------------------------------------------ Build time: 2021-08-17 09:59:03 UTC Revision: a773786b58bb28710e3dc96c4d1a7063628952ad Kotlin: 1.5.21 Groovy: 3.0.8 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 17.0.1 (GraalVM Community 17.0.1+12-jvmci-21.3-b05) OS: Mac OS X 11.6 x86_64
Additional information
The error occurs since Quarkus 2.3.0.Final.
I can also reproduce the error with Java 11 and GraalVM 21.2.
The text was updated successfully, but these errors were encountered: