[ 
https://issues.apache.org/jira/browse/CXF-7333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Beryozkin resolved CXF-7333.
-----------------------------------
    Resolution: Cannot Reproduce
      Assignee: Sergey Beryozkin

Please reopen if it still does not work and you have a test available, thanks 

> 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
>            Assignee: Sergey Beryozkin
>            Priority: Major
>
> 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
(v7.6.3#76005)

Reply via email to