Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3050

HeaderUtils requires --add-opens on JDK 17

    XMLWordPrintable

Details

    Description

      I am seeing the following TCK failure when running the Microprofile Rest Client TCK on Java 17. I'm testing OpenLiberty which uses Resteasy 4.7.2.Final for it's Microprofile Rest Client implementation:

      java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.invoke.MethodHandles$Lookup(java.lang.Class) accessible: module 
          at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
          at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
          at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
          at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
          at org.jboss.resteasy.microprofile.client.header.JdkSpecific.createMethodHandle(JdkSpecific.java:41)
          at org.jboss.resteasy.microprofile.client.header.HeaderUtils.createMethodHandle(HeaderUtils.java:25)
          at org.jboss.resteasy.microprofile.client.header.DefaultHeaderFiller.<init>(DefaultHeaderFiller.java:40)
          at org.jboss.resteasy.microprofile.client.header.DefaultHeaderFillerFactory.createFiller(DefaultHeaderFillerFactory.java:19)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderGenerator.<init>(ClientHeaderGenerator.java:35)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderProvider.lambda$forMethod$1(ClientHeaderProvider.java:39)
          at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
          at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
          at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
          at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
          at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
          at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
          at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
          at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
          at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderProvider.forMethod(ClientHeaderProvider.java:39)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderProviders.registerForMethod(ClientHeaderProviders.java:98)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderProviders.lambda$registerForClass$0(ClientHeaderProviders.java:72)
          at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
          at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
          at org.jboss.resteasy.microprofile.client.header.ClientHeaderProviders.registerForClass(ClientHeaderProviders.java:72)
          at org.jboss.resteasy.microprofile.client.ot.LibertyRestClientBuilderImpl.build(LibertyRestClientBuilderImpl.java:384)
          at org.eclipse.microprofile.rest.client.tck.ClientHeaderParamTest.client(ClientHeaderParamTest.java:65)
          at org.eclipse.microprofile.rest.client.tck.ClientHeaderParamTest.testMultivaluedHeaderSentWhenInvokingComputeMethodFromSeparateClass(
      

      I found https://issues.redhat.com/browse/RESTEASY-2905 which is the exact same problem I'm seeing, but on Java 16 instead.
      (https://github.com/resteasy/resteasy/pull/2820)

       

      Does Resteasy need to be updated to handle Java 17, or has this already been fixed in a newer release?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              atanders Adam Anderson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: