cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-7333) Custom resource comparator not called on sub-resource classes
Date Thu, 27 Apr 2017 21:15:04 GMT

    [ https://issues.apache.org/jira/browse/CXF-7333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15987692#comment-15987692
] 

Sergey Beryozkin edited comment on CXF-7333 at 4/27/17 9:14 PM:
----------------------------------------------------------------

I can not reproduce it, I experimented with one of the existing tests and the custom comparator
is called when the multiple candidates are available both on the root and sub resources.

Can you please create a Maven based test project ?


was (Author: sergey_beryozkin):
I can not reproduce it, I experimented with one of the existing tests and the custom comparator
is called both when the multiple candidates are available both on the root and sub resources.

Can you please create a Maven based test project ?

> Custom resource comparator not called on sub-resource classes
> -------------------------------------------------------------
>
>                 Key: CXF-7333
>                 URL: https://issues.apache.org/jira/browse/CXF-7333
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.11
>         Environment: Mac OS X 10.12.4
> Oracle Java Runtime 1.8.0_60-b27
> Tomcat 8.5.11
> debugged and executed via Eclipse Neon.3 Release (4.6.3) 
>            Reporter: Thomas Iguchi
>
> I created a custom `ResourceComparator` according to the documentation: https://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Customselectionbetweenmultipleresourcesoroperations
> Its method for comparing resource classes gets called just fine, but the one for comparing
two instances of OperationResourceInfo never gets called when I want to invoke a method of
a sub-resource class such as the following example for illustration:
> ```
> @Path("subpath")
> public class SubResource {
>     @POST
>     public Response createSomething() {
>         // ... this is the method I want to compare, since there's a "competitor" with
the same method signature in  an abstract base class
>     }
> }
> @Path("/rootpath")
> public class RootResource {
>     @Path("subpath")
>     public SubResource subResource() {
>          return new SubResource();
>     }
> }
> ```
> I stepped through the CXF code and could narrow down the problem to the following line
of code:
> In line 48 of `org.apache.cxf.jaxrs.model.OperationResourceInfoComparator` the looked
up custom comparator from the environment returns as `null`. It appears as if the message
endpoint object for the sub-resource class contains incomplete information about the environment.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message