You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/12/03 12:24:35 UTC
[jira] [Resolved] (CXF-5432) JAX-RS resources finding fails in case
@Path is non-unique
[ https://issues.apache.org/jira/browse/CXF-5432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-5432.
-----------------------------------
Resolution: Invalid
Assignee: Sergey Beryozkin
Hi, the issue is invalid: in JAX-RS 1.1 having identical root Paths is indeed leading to unpredictable selections, in JAX-RS 2.0 it is possible to do, it has been implemented in 3.0.0-milestone1:
http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Updatestothematchingalgorithm
In CXF 2.7.x or earlier use CXF ResourceComparator:
http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Customselectionbetweenmultipleresources
thanks
> JAX-RS resources finding fails in case @Path is non-unique
> ----------------------------------------------------------
>
> Key: CXF-5432
> URL: https://issues.apache.org/jira/browse/CXF-5432
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.7.6
> Reporter: Valentin Mayamsin
> Assignee: Sergey Beryozkin
> Priority: Minor
>
> Let's say I have two resources:
> {code}
> @Path("resource")
> class ResourceOne {
> @Path("one")
> String getSomething();
> }
> @Path("resource")
> class ResourceTwo {
> @Path("two")
> String doSomething();
> }
> {code}
> So there are two URIs to access them:
> resource/one
> resource/two
> With the current implementation one of them would fail.
> The reason is org.apache.cxf.jaxrs.model.ClassResourceInfoComparator assumes @Path values are unique which is not necessarily true.
> Workaround is to make @Path value unique for root resources.
--
This message was sent by Atlassian JIRA
(v6.1#6144)