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

RestClientDefinitionException on Closeable#close due to wrong template

XMLWordPrintable

    • Undefined

      A RestClientDefinitionException is thrown when adding java.io.Closeable to the REST service interface:

      org.eclipse.microprofile.rest.client.RestClientDefinitionException: Parameters and variables don't match on interface MyClass$MyInterface::close

      The interface is:

      public interface MyInterface extends Closeable {
        @javax.ws.rs.GET
        @javax.ws.rs.Path("{endPoint}")
        Response getResponse(@PathParam("endPoint") String path, @QueryParam("id") String id);
      }

      It works with RestEasy v4.5.8!

      After investigating the differences I was able to tackle it down to this line:

      https://github.com/resteasy/Resteasy/blob/3.14.0.Final/resteasy-client-microprofile/src/main/java/org/jboss/resteasy/microprofile/client/RestClientBuilderImpl.java#L408

      respectively:

      https://github.com/resteasy/Resteasy/blob/3.14.0.Final/resteasy-jaxrs/src/main/java/org/jboss/resteasy/specimpl/ResteasyUriBuilder.java#L137

      Somehow the template does not get changed. It stuck with the PathParam instead of "foobar" and ultimately LOC#403 if (allVariables.size() != paramMap.size()) fails.

      Possible fix for L408:

      template = template.resolveTemplates(paramMap, false).build();
      

              rsigal@redhat.com Ronald Sigal
              svenhaag Sven Haag (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: