[ https://issues.apache.org/jira/browse/CXF-7527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16246524#comment-16246524 ]
Andy McCright commented on CXF-7527: ------------------------------------ Hi [~sergey_beryozkin], this looks like a bug to me. I modified the test app a little and deployed it to Liberty - when I invoked GET {{http://localhost:9080/CXF7527/my/resource/aValue/subresource}} , I got {{/my/resource/aValue/subresource/,/my/resource/aValue/subresource,/my/resource/aValue}} When I ran in the EE8 RI (Glassfish 5 - keep in mind that this is JAX-RS 2.1, not 2.0, but I don't recall anything changing in the 2.1 spec wrt UriInfo), I got {{my/resource/aValue/subresource,my/resource/aValue}} I did a little debugging of UriInfoImpl and it looks like it adds _essentially_ the same path twice. It loops through the MethodInvocationInfos on the stack - there are two (one for the method on Resource, and one for the SubResource). The first time through the loop it adds {{/my/resource/aValue}} as the CRI's URI template - then it adds {{/my/resource/aValue/subresource}} as the ORI's URI template - it also sets that as the sumPath. The second time through (the MethodInvocationInfo for SubResource's method), there is no CRI URI template (so nothing added), but it finds an ORI URI template of "/" (implicit?) that it appends to the sumPath and then adds it to the List. I think that is wrong - it should not add the URI that basically is the previous URI plus a "/". I can try to code up a fix for it. Thanks, Andy > JAXRS UriInfo.getMatchedUris does return matched URIs twice for sub resources > ----------------------------------------------------------------------------- > > Key: CXF-7527 > URL: https://issues.apache.org/jira/browse/CXF-7527 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.1.12 > Reporter: Lenoire > Attachments: uriinfo-issues.jar > > > Invoking method {{UriInfo.getMatchedURIs()}} return matched resource URI > twice when invoked from SubResource method. > See attachment for a junit test reproducing the issue (=> > {{testMatchedUrisFromSubResource()}}) -- This message was sent by Atlassian JIRA (v6.4.14#64029)