[ https://issues.apache.org/jira/browse/CXF-6299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14360481#comment-14360481 ]
Daumantas commented on CXF-6299: -------------------------------- No, I'm saying, that providers from bus are being registered only which ones extends MessageBodyReader.class/MessageBodyWriter.class/ExceptionMapper.class and others being ignored (don't know exactly why). But it seems like all being loaded from xml configuration, and on service call custom providers in used ProviderFactory instance are missing. > Providers registered in cxf bus are ignored. > -------------------------------------------- > > Key: CXF-6299 > URL: https://issues.apache.org/jira/browse/CXF-6299 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.8, 2.7.15 > Environment: JDK 1.7.0_55 > Reporter: Daumantas > > Providers list configured following > http://cxf.apache.org/docs/jaxrs-services-configuration.html documentation. > Bus object created with configuration and is being set to ProviderFactory, > but configured providers from bus are never used by ProviderFactory. > To fix problem following example can be used (updated existing initialization > method): > {code:title=AbstractJAXRSFactoryBean|language=java} > ... > private static final Object BUS_PROVIDERS_ALL = > "org.apache.cxf.jaxrs.bus.providers"; > ... > protected ProviderFactory setupFactory(Endpoint ep) { > ProviderFactory factory = ProviderFactory.createInstance(getBus()); > if (entityProviders != null) { > Map<String, Object> busProperties = getBus().getProperties(); > List<?> busProviders = > (List<?>)busProperties.get(BUS_PROVIDERS_ALL); > if (busProviders != null) { > entityProviders.addAll(busProviders); > } > factory.setUserProviders(entityProviders); > } > setDataBindingProvider(factory, ep.getService()); > > factory.setBus(getBus()); > factory.initProviders(serviceFactory.getRealClassResourceInfo()); > if (schemaLocations != null) { > factory.setSchemaLocations(schemaLocations); > } > > setBeanInfo(factory); > > ep.put(ProviderFactory.class.getName(), factory); > getBus().setProperty(ProviderFactory.class.getName(), factory); > return factory; > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)