You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ivan Bondarenko (JIRA)" <ji...@apache.org> on 2013/10/25 14:47:30 UTC

[jira] [Updated] (CXF-5360) Resource classes are selected incorrectly

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

Ivan Bondarenko updated CXF-5360:
---------------------------------

    Description: 
The problem: the resource is selected incorrectly when multiple classes can 'visually' handle request. For example if we have two classes
{code}@Path("/") class Foo {
  @GET @Path("bar") public String bar() { return "bar"; }
}
@Path("/") class Real {
  @GET @Path("hello") public String hello() { return "hello"; }
}{code}
and their instances are registered in this order (e.g. in jaxrs:serviceBeans), when I GET the "/hello" path, the Foo will be selected, while it is not even able to handle this request.
The starting point to investigate the problem is org.apache.cxf.jaxrs.utils.JAXRSUtils.selectResourceClass(List<ClassResourceInfo>, String, MultivaluedMap<String, String>, Message), where 'candidateList' variable is filled incorrectly. Unfortunately I'm not so familiar with CXF code to provide a patch, but resource class must be selected basing on full class description (all methods and annotations must be taken into account).

Why this is a problem: except obvious reason (unexpected behavior), this bug disallows to make REST service modular. For example we may want to provide different feature sets for different servers. Right now it is not possible to implement.


  was:
The problem: the resource is selected incorrectly when multiple classes can 'visually' handle request. For example if we have two classes
@Path("/") class Foo {
  @GET @Path("bar") public String bar() { return "bar"; }
}
@Path("/") class Real {
  @GET @Path("hello") public String hello() { return "hello"; }
}
and their instances are registered in this order (e.g. in jaxrs:serviceBeans), when I GET the "/hello" path, the Foo will be selected, while it is not even able to handle this request.
The starting point to investigate the problem is org.apache.cxf.jaxrs.utils.JAXRSUtils.selectResourceClass(List<ClassResourceInfo>, String, MultivaluedMap<String, String>, Message), where 'candidateList' variable is filled incorrectly. Unfortunately I'm not so familiar with CXF code to provide a patch, but resource class must be selected basing on full class description (all methods and annotations must be taken into account).

Why this is a problem: except obvious reason (unexpected behavior), this bug disallows to make REST service modular. For example we may want to provide different feature sets for different servers. Right now it is not possible to implement.



> Resource classes are selected incorrectly
> -----------------------------------------
>
>                 Key: CXF-5360
>                 URL: https://issues.apache.org/jira/browse/CXF-5360
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.7
>            Reporter: Ivan Bondarenko
>            Priority: Blocker
>
> The problem: the resource is selected incorrectly when multiple classes can 'visually' handle request. For example if we have two classes
> {code}@Path("/") class Foo {
>   @GET @Path("bar") public String bar() { return "bar"; }
> }
> @Path("/") class Real {
>   @GET @Path("hello") public String hello() { return "hello"; }
> }{code}
> and their instances are registered in this order (e.g. in jaxrs:serviceBeans), when I GET the "/hello" path, the Foo will be selected, while it is not even able to handle this request.
> The starting point to investigate the problem is org.apache.cxf.jaxrs.utils.JAXRSUtils.selectResourceClass(List<ClassResourceInfo>, String, MultivaluedMap<String, String>, Message), where 'candidateList' variable is filled incorrectly. Unfortunately I'm not so familiar with CXF code to provide a patch, but resource class must be selected basing on full class description (all methods and annotations must be taken into account).
> Why this is a problem: except obvious reason (unexpected behavior), this bug disallows to make REST service modular. For example we may want to provide different feature sets for different servers. Right now it is not possible to implement.



--
This message was sent by Atlassian JIRA
(v6.1#6144)