cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Michalec (JIRA)" <>
Subject [jira] Created: (CXF-1982) Sub-resource locator fails on subtyping
Date Thu, 15 Jan 2009 03:05:59 GMT
Sub-resource locator fails on subtyping

                 Key: CXF-1982
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.1.3, 2.2
            Reporter: Andrzej Michalec

Attempt to use subresource locator with subtyping lead to following problem:

2009-01-15 03:31:28 org.apache.cxf.jaxrs.JAXRSServiceFactoryBean checkMethodDispatcher
WARNING: No resource methods found for resource class org.apache.cxf.jaxrs.model.ClassResourceInfo
2009-01-15 03:31:28
INFO: Destroying singletons in
defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.transport.servlet.ServletTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,jaxRsServer];
root of factory hierarchy
2009-01-15 03:31:28 org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jaxRsServer':
Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans'
threw exception; nested exception is java.lang.NullPointerException
	at Method)

To reproduces on CXF 2.2 use following code snippet (it also fails in CXF 2.1.3-stable using

public class RootService {

	public String getThis() {
		return "<root>Root service</root>";

	//@GET disabled to delegate to sub-resource
	//when SubService is returned it works fine
	//when java.lang.Object is returned it FAILS with Spring autowiring... weird
	public SubService getSub() {
		return new SubService();
public class SubService {

	private String value = "sub value";
	public Object getThis() {
		return this;

	public String getValue() {
		return value;

I believe JAX-RS specification clearly points out that
"[...]implementation MUST dynamically determine the class of object returned rather than relying
on the static sub-resource locator return type since the returned instance may be a subclass
of the declared type with potentially different annotations[...]"

As reference see Jboss example returning java.lang.Object from locator:

If there are some assumed limitation please provide workarounds for dynamic subresources.

(Side note: effective behavior is very similar to CXF-1762 suffering from method dispatching
problems; maybe solution is similar).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message