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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@apache.org
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)