cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <ben...@basistech.com>
Subject JAX-RS considering the same bean twice in 3.1.2?
Date Thu, 27 Aug 2015 14:02:55 GMT
There is one bean with one method named 'runCategorization', but I get
a complaint that it's having trouble making up it's mind, as if I'd
added it twice. The code used from prior versions does add both a
resource class and a service bean for the same thing. Was that always
silly?

3165 [main] WARN  org.apache.cxf.jaxrs.utils.JAXRSUtils  - Both
com.basistech.ws.frontend.service.RaasRsCategorizationService#runCategorization
and com.basistech.ws.frontend.service.RaasRsCategorizationService#runCategorization
are equal candidates for handling the current request which

Here is the setup code:

AbstractRaasRsService raasRsService = new RaasRsPingService(); // some
service or another. Why?
raasRsService.setClientFactory(mockedWsBusClientFactory);
raasRsService.setRequestTracker(mockedRequestTracker);
raasRsService.setLanguageofUseIdentifier(mockedLanguageOfUseIdentifier);
serviceBeans.add(0, raasRsService);

JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setServiceBeanObjects(serviceBeans);
sf.setResourceClasses(resourceClasses);
sf.setResourceProviders(resourceProviders);
sf.setProvider(new JacksonJaxbJsonProvider(JsonUtils.getObjectMapper(),
        JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS));
sf.setProvider(new JsonExceptionMapper());
sf.setProvider(new WebApplicationExceptionMapper());
sf.setProvider(new GenericExceptionMapper());
sf.setAddress(endpointAddress());
server = sf.create();

and then:

protected void addChildService(Class<? extends AbstractRaasRsService>
clazz) throws Exception {
    AbstractRaasRsService childService = clazz.newInstance();
    childService.setClientFactory(mockedWsBusClientFactory);
    childService.setRequestTracker(mockedRequestTracker);
    serviceBeans.add(childService);
    resourceClasses.add(clazz);
    resourceProviders.add(new SingletonResourceProvider(childService, true));
}

Mime
View raw message