Hi
On 22/04/15 12:20, Francesco Chicchiriccò wrote:
On 22/04/2015 12:48, Sergey Beryozkin wrote:
Hi Francesco

I suppose the problem lies somewhere starting from

https://github.com/apache/syncope/blob/master/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/QueryResourceInfoComparator.java#L77


It is a custom implementation and I guess the rating becomes
problematic when both query and matrix parameters are used.
It may make sense, going forward, to strictly depend on a JAX-RS only
matching logic (note Query and Matrix parameters can not affect the
selection process in a pure JAX-RS) but I agree it can be sensitive to
migrate the code.

Well, the ongoing changes towards 2.0.0 are substantial, so I would not
have problems in removing QueryResourceInfoComparator, if this means
improving our compliance with JAX-RS best practices.

Does this also mean that we need to remove all duplicate methods (see
list() or search() with variable arguments)?

Yes, unless some of the methods are available on unique @Paths.


Can you please get a breakpoint at the above code ? We can chat and
see afterwards if a comparator can be tuned further?

I've already done this before deciding to (hopefully temporarily) switch
back to @QueryParam: only the ClassResourceInfo's compare gets invoked,
not OperationResourceInfo's; as a result, getMatchingRate() is not
invoked at all in this case.

So you are actually seeing 404... Sorry, you actually did say it. I thought it was a case of multiple matching methods with the one having a Matrix parameter being one of them but not selected in the end :-)...

the request URI is something like
"/users;realm=a;realm=b"

?

This all should work but I wonder if there's some subtle bug in CXF if you have a default/empty Path as in UserService list...I'll need to have a look

Thanks, Sergey


Thanks for your support.
Regards.

On 22/04/15 11:36, Francesco Chicchiriccò wrote:
Hi,
I have recently experimented some troubles in matching REST methods
using @MaxtrixParam.

If you take a look at [1], this works fine; when changing the first
@QueryParam to @MatrixParam instead, CXF throws a "Not Found" exception.
At first I thought that the problem might depend on the fact that there
are many methods with same name, but the problem occurs even if I leave
only the version with all parameters (e.g. the one at [1]).

FYI, we are using a custom OperationResourceInfoComparator [2].

Any idea?
TIA

Regards.

[1]
https://github.com/apache/syncope/blob/master/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java#L146


[2]
https://github.com/apache/syncope/blob/master/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/QueryResourceInfoComparator.java



Reply via email to