Hi Francesco,
> Hi all, > we had some discussion in the past about random errors with Java 7 and the > -Pjaxrs Maven profile. > Today I have updated CXF from 2.7.3 to 2.7.4 and most of such errors seems > to disappear (I've been executing some times -Pjaxrs with either OpenJDK 7 > and Oracle JDK 7 on different platforms). Cool! > > Only two remain, in ConnInstanceTestITCase, when calling > > connectorService.list(null) > > This call is intentioned to be routed to ConnectorServiceImpl.list(null), > while > instead it goes to > ConnectorService.readByResource(null): I guess that CXF gets confused by > the JAX-RS annotations on ConnectorService: > > @GET > List<ConnInstanceTO> list(@QueryParam("lang") String lang); > > @GET > ConnInstanceTO readByResource(@MatrixParam("resourceName") String > resourceName); > > with null param, in fact, there seems to be no way find the right match. > > Why don't we have instead > > @GET > @Path("{resourceName}") > ConnInstanceTO readByResource(@PathParam("resourceName") String > resourceName); > > ? This should solve the issue, but I guess there is some best practice here, > so > here's why I am asking. > > For the moment I have changed, in ConnInstanceTestITCase the calls above > to > > connectorService.list("") > > and this makes the tests run smoothly. > Currently CXF method selection is extended by org.apache.syncope.core.rest.utils.QueryResourceInfoComperator. This comparator additionally analyses Query and Matrix parameters to select a correct method. I do not exactly remember the reason why it was done this way. However I tend to use classic path selection for readByResource() as well. Resource name is reasonable path parameter. > Final remark: why "ConnectorService" (and derived) instead of > ConnInstanceService (and derived)? Connectors and ConnInstance (e.g. > connector instances) are distinct in Syncope. > Not sure ... the name seems to be ConnectorService from beginning. Will ping Jan regarding it. Regards, Andrei. > Regards. > > -- > Francesco Chicchiriccò > > ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member > http://people.apache.org/~ilgrosso/