Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-1378

Microprofile fallback doesn't work with JDK17

XMLWordPrintable

      Microprofile fallback doesn't work with JDK17

      Quarkus:2.2.3.Final ->  Works as expected

      Quarkus version: 2.2.3.Final-redhat-00013  -> Fails

      Reproducer: 

      https://github.com/quarkus-qe/quarkus-test-suite/tree/2.2

      cmd: 

      mvn clean verify -Dquarkus.platform.version=2.2.3.Final-redhat-00013 -Dquarkus-plugin.version=2.2.3.Final-redhat-00013 -Dmaven.repo.local=/home/pablojosegonzalezgranados/Downloads/rh-quarkus-2.2.3.CR5-maven-repository/rh-quarkus-2.2.3.GA-maven-repository/maven-repository -Dmaven.compiler.source=17 -Dmaven.compiler.target=17 -pl monitoring/microprofile-opentracing/
      

      JVM: openJDK 17

      Error reported: 

      19:23:10,706 INFO  [app] 19:23:08,015 RESTEASY002020: Unhandled asynchronous exception, sending back 500: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.invoke.MethodHandles$Lookup(java.lang.Class) accessible: module java.base does not "opens java.lang.invoke" to unnamed module @5ebec15
      19:23:10,709 INFO  [app]        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
      19:23:10,710 INFO  [app]        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
      19:23:10,711 INFO  [app]        at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
      19:23:10,712 INFO  [app]        at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
      19:23:10,713 INFO  [app]        at io.smallrye.faulttolerance.DefaultMethodFallbackProvider.getFallback(DefaultMethodFallbackProvider.java:19)
      19:23:10,714 INFO  [app]        at io.smallrye.faulttolerance.FaultToleranceInterceptor.lambda$prepareFallbackFunction$11(FaultToleranceInterceptor.java:503)
      19:23:10,715 INFO  [app]        at io.smallrye.faulttolerance.core.fallback.AsyncFallbackFunction.lambda$call$0(AsyncFallbackFunction.java:23)
      19:23:10,716 INFO  [app]        at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
      19:23:10,717 INFO  [app]        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:548)
      19:23:10,718 INFO  [app]        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
      19:23:10,718 INFO  [app]        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
      19:23:10,719 INFO  [app]        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
      19:23:10,721 INFO  [app]        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
      19:23:10,722 INFO  [app]        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      19:23:10,723 INFO  [app]        at java.base/java.lang.Thread.run(Thread.java:833)
      19:23:10,724 INFO  [app] 19:23:09,591 RESTEASY002020: Unhandled asynchronous exception, sending back 500: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.invoke.MethodHandles$Lookup(java.lang.Class) accessible: module java.base does not "opens java.lang.invoke" to unnamed module @5ebec15
      19:23:10,726 INFO  [app]        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
      19:23:10,727 INFO  [app]        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
      19:23:10,728 INFO  [app]        at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
      19:23:10,729 INFO  [app]        at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
      19:23:10,730 INFO  [app]        at io.smallrye.faulttolerance.DefaultMethodFallbackProvider.getFallback(DefaultMethodFallbackProvider.java:19)
      19:23:10,732 INFO  [app]        at io.smallrye.faulttolerance.FaultToleranceInterceptor.lambda$prepareFallbackFunction$11(FaultToleranceInterceptor.java:503)
      19:23:10,733 INFO  [app]        at io.smallrye.faulttolerance.core.fallback.AsyncFallbackFunction.lambda$call$0(AsyncFallbackFunction.java:23)
      19:23:10,734 INFO  [app]        at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
      19:23:10,734 INFO  [app]        at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:548)
      19:23:10,735 INFO  [app]        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
      19:23:10,736 INFO  [app]        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
      19:23:10,736 INFO  [app]        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
      19:23:10,737 INFO  [app]        at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
      19:23:10,738 INFO  [app]        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      19:23:10,738 INFO  [app]        at java.base/java.lang.Thread.run(Thread.java:833)
      
      

      Test link: https://github.com/quarkus-qe/quarkus-test-suite/blob/2.2/monitoring/microprofile-opentracing/src/test/java/io/quarkus/ts/microprofile/MicroProfileIT.java#L126

      Analyse:

      We've concluded that the error is located in this library:

       <dependency>
                  <groupId>io.smallrye</groupId>
                  <artifactId>smallrye-fault-tolerance</artifactId>
      </dependency>

      That comes as a transitive dependency by

      <dependency>
          <groupId>io.quarkus</groupId>
          <artifactId>quarkus-smallrye-fault-tolerance</artifactId>
      </dependency>
      

      We did a workaround in order to make it works as you can see in the following branch:

      https://github.com/pjgg/quarkus-test-suite/blob/reproducer_fault_tolerance/monitoring/microprofile-opentracing/pom.xml#L37

       

              hamadhan@redhat.com Harsh Madhani (Inactive)
              rhn-support-pagonzal Pablo Gonzalez Granados (Inactive)
              Pablo Gonzalez Granados Pablo Gonzalez Granados (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: