You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andy McCright (JIRA)" <ji...@apache.org> on 2018/12/06 19:39:00 UTC

[jira] [Created] (CXF-7922) Unable to invoke default interface methods in proxy-based clients

Andy McCright created CXF-7922:
----------------------------------

             Summary: Unable to invoke default interface methods in proxy-based clients
                 Key: CXF-7922
                 URL: https://issues.apache.org/jira/browse/CXF-7922
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 3.2.7
            Reporter: Andy McCright
            Assignee: Andy McCright


{{When invoking a default method on an interface used as a MicroProfile Rest Client interface (and presumably the JAX-RS proxy-based client), I see the following exception:}}

{{javax.ws.rs.ProcessingException: Method org.apache.cxf.microprofile.client.mock.MyClient.myDefaultMethod is not a valid resource method}}
{{ at org.apache.cxf.microprofile.client.CxfTypeSafeClientBuilderTest.testCanInvokeDefaultInterfaceMethods(CxfTypeSafeClientBuilderTest.java:172)}}

 

Invoking default interface methods from a dynamic proxy's InvocationHandler is outlined in this article:

[https://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/]

 

{{This type of operation becomes critical when combining the MicroProfile Rest Client with MP Fault Tolerance annotations like this:}}

{{public interface MyClient {}}
{{    @GET}}
{{    @Fallback(fallbackMethod="useFallback")}}
{{    String tryActualRemoteRequest();}}
{{}}{{    default String useFallback() {}}
{{        return "useful default value";}}
{{    }}}
{{}}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)