Closed zakkak closed 1 day ago
/cc @Karm (mandrel), @galderz (mandrel)
Last time I saw this issue (which was recently, but yet I don't remember where it was), it was because of a class which had javax
vs jakarta
(i.e. a version mismatch problem). I don't know whether that might be the case here though.
I don't know whether that might be the case here though.
I think it's not related to this. Note that we see the issue with other packages as well, e.g. java.sql
This should now be fixed by https://github.com/oracle/graal/pull/9184, I will wait for the CI to confirm.
Example errors of this look like:
2024-06-18 03:52:55,782 ERROR [io.und.req.io] (executor-thread-1) Exception handling request aa886ec8-cb17-44e6-9d69-b4300fab13ee-1 to /fruits: java.lang.BootstrapMethodError: java.lang.NoSuchMethodError: jakarta.ws.rs.ext.Providers.getContextResolver(java.lang.Class, jakarta.ws.rs.core.MediaType)
at jdk.proxy4/jdk.proxy4.$Proxy/sfa608265.getContextResolver(Unknown Source)
at com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider._locateMapperViaProvider(JacksonJsonProvider.java:197)
Describe the bug
Starting with GraalVM for JDK 23 we see a lot of
java.lang.BootstrapMethodError: java.lang.NoSuchMethodError
, see https://github.com/oracle/graal/actions/runs/9558273459I don't fully understand what's happening but the issue seems related to https://bugs.openjdk.org/browse/JDK-8229959.
I initially thought that registering the missing methods would be enough, but it looks like this is not the right way to go for all cases as some of the proxied classes may be used by the application itself and we don't know which methods will be reflective accessed in this case. E.g. in https://github.com/quarkusio/quarkus/blob/50372634952488c3249f0f3bc4982792653cfd9f/integration-tests/spring-web/src/main/java/io/quarkus/it/spring/web/CustomAdvice.java#L37
the test is invoking
getRequestURI
on the proxiedHttpServletRequest
resulting in the following error/trace:Since we don't know what methods might be invoked on the proxied classes I think we need to register all methods of proxied classes for reflective access. I am not sure how to detect which classes are being proxied though...
Expected behavior
Tests should build and pass as they do with GraalVM for JDK 21 and 22
Actual behavior
Tests fail with errors like the following:
How to Reproduce?
GRAALVM_HOME
to point to the extracted directory./mvnw -Dnative -pl integration-tests/spring-web -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests clean verify -Dquarkus.native.container-build=false -Dtest-containers -Dstart-containers
Output of
uname -a
orver
No response
Output of
java -version
23 and 24
Mandrel or GraalVM version (if different from Java)
GraalVM for JDK 23 (and 24)
Quarkus version or git rev
50372634952488c3249f0f3bc4982792653cfd9f
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response