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)?
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.
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
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/