You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Simon Gerber (JIRA)" <ji...@apache.org> on 2013/06/07 02:18:20 UTC
[jira] [Created] (CXF-5066) Annotation inheritance does not work if
a non JAX-RS annotation is present on an implementation method
Simon Gerber created CXF-5066:
---------------------------------
Summary: Annotation inheritance does not work if a non JAX-RS annotation is present on an implementation method
Key: CXF-5066
URL: https://issues.apache.org/jira/browse/CXF-5066
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 2.7.5
Reporter: Simon Gerber
Priority: Minor
Consider an annotated interface and implementation as follows
{noformat}
@Path("example")
public interface Example {
@GET
ExampleResponse get();
}
public class ExampleImpl {
@Override
public ExampleResponse get() { // ... }
}
{noformat}
In the above example CXF will reject this resource ResourceUtils.createClassResourceInfo() fails to find any dispatcher methods.
The reason for this is that AnnotationUtils.doGetAnnotatedMethod() returns the concrete class method because it has an Override annotation on it. Therefore it does not find the method annotation.
The workaround is to remove the Override annotation - however since many IDEs (such as Eclipse) are configured to add this by default it could be considered a case where user expectations will not be met. This caveat was not documented anywhere and it required debugging into the CXF source code to isolate the issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira