You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2018/12/17 12:14:00 UTC
[jira] [Resolved] (CXF-7922) Unable to invoke default interface
methods in proxy-based clients
[ https://issues.apache.org/jira/browse/CXF-7922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh resolved CXF-7922.
--------------------------------------
Resolution: Fixed
> 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
> Priority: Minor
> Fix For: 3.3.0, 3.2.8
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{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)