Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 12261 invoked from network); 29 Jan 2009 14:21:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2009 14:21:30 -0000 Received: (qmail 34778 invoked by uid 500); 29 Jan 2009 14:21:30 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 34766 invoked by uid 500); 29 Jan 2009 14:21:30 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 34755 invoked by uid 99); 29 Jan 2009 14:21:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2009 06:21:30 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2009 14:21:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BD042234C498 for ; Thu, 29 Jan 2009 06:20:59 -0800 (PST) Message-ID: <1753406125.1233238859773.JavaMail.jira@brutus> Date: Thu, 29 Jan 2009 06:20:59 -0800 (PST) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Subject: [jira] Updated: (CXF-1982) Sub-resource locator fails on subtyping In-Reply-To: <845439509.1231988759634.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1982?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Sergey Beryozkin updated CXF-1982: ---------------------------------- Fix Version/s: 2.2 > Sub-resource locator fails on subtyping > --------------------------------------- > > Key: CXF-1982 > URL: https://issues.apache.org/jira/browse/CXF-1982 > Project: CXF > Issue Type: Bug > Components: REST > Affects Versions: 2.1.3, 2.2 > Environment: Tomcat 5.5.x > Reporter: Andrzej Michalec > Assignee: Sergey Beryozkin > Fix For: 2.1.4, 2.2 > > Attachments: beans.xml, web.xml > > > Attempt to use subresource locator with subtyping lead to following probl= em: > 2009-01-15 03:31:28 org.apache.cxf.jaxrs.JAXRSServiceFactoryBean checkMet= hodDispatcher > WARNING: No resource methods found for resource class org.apache.cxf.jaxr= s.model.ClassResourceInfo > 2009-01-15 03:31:28 org.springframework.beans.factory.support.DefaultSing= letonBeanRegistry destroySingletons > INFO: Destroying singletons in org.springframework.beans.factory.support.= DefaultListableBeanFactory@1891d5d: defining beans [cxf,org.apache.cxf.bus.= spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactor= yPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache= .cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceM= anager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.Bindi= ngFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apa= che.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,o= rg.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,= org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.Ser= verRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.e= ndpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerR= egistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.hea= ders.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cx= f.endpoint.ServiceContractResolverRegistry,org.apache.cxf.transport.servlet= .ServletTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,jaxRsServ= er]; root of factory hierarchy > 2009-01-15 03:31:28 org.springframework.web.context.ContextLoader initWeb= ApplicationContext > SEVERE: Context initialization failed > org.springframework.beans.factory.BeanCreationException: Error creating b= ean with name 'jaxRsServer': Error setting property values; nested exceptio= n is org.springframework.beans.PropertyBatchUpdateException; nested Propert= yAccessExceptions (1) are: > PropertyAccessException 1: org.springframework.beans.MethodInvocationExce= ption: Property 'serviceBeans' threw exception; nested exception is java.la= ng.NullPointerException > =09at org.springframework.beans.factory.support.AbstractAutowireCapableBe= anFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1278) > =09at org.springframework.beans.factory.support.AbstractAutowireCapableBe= anFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) > =09at org.springframework.beans.factory.support.AbstractAutowireCapableBe= anFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) > =09at org.springframework.beans.factory.support.AbstractAutowireCapableBe= anFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) > =09at java.security.AccessController.doPrivileged(Native Method) > =09at org.springframework.beans.factory.support.AbstractAutowireCapableBe= anFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) > =09at org.springframework.beans.factory.support.AbstractBeanFactory$1.get= Object(AbstractBeanFactory.java:264) > =09at org.springframework.beans.factory.support.DefaultSingletonBeanRegis= try.getSingleton(DefaultSingletonBeanRegistry.java:221) > =09at org.springframework.beans.factory.support.AbstractBeanFactory.doGet= Bean(AbstractBeanFactory.java:261) > =09at org.springframework.beans.factory.support.AbstractBeanFactory.getBe= an(AbstractBeanFactory.java:185) > =09at org.springframework.beans.factory.support.AbstractBeanFactory.getBe= an(AbstractBeanFactory.java:164) > =09at org.springframework.beans.factory.support.DefaultListableBeanFactor= y.preInstantiateSingletons(DefaultListableBeanFactory.java:429) > =09at org.springframework.context.support.AbstractApplicationContext.fini= shBeanFactoryInitialization(AbstractApplicationContext.java:729) > ...=20 > To reproduces on CXF 2.2 use following code snippet (it also fails in CXF= 2.1.3-stable using @ProduceMime): > @Produces("text/xml") > public class RootService { > =09@GET > =09@Path("/") > =09public String getThis() { > =09=09return "Root service"; > =09} > =09//@GET disabled to delegate to sub-resource > =09//when SubService is returned it works fine > =09//when java.lang.Object is returned it FAILS with Spring autowiring...= weird > =09@Path("/sub") > =09public SubService getSub() { > =09=09return new SubService(); > =09} > } > ------------- > @Produces("text/xml") > @XmlRootElement > public class SubService { > =09private String value =3D "sub value"; > =09 > =09@GET > =09public Object getThis() { > =09=09return this; > =09} > =09@GET > =09@Path("/value") > =09public String getValue() { > =09=09return value; > =09} > } > I believe JAX-RS specification clearly points out that > "[...]implementation MUST dynamically determine the class of object retur= ned rather than relying on the static sub-resource locator return type sinc= e the returned instance may be a subclass of the declared type with potenti= ally different annotations[...]" > As reference see Jboss example returning java.lang.Object from locator: h= ttp://www.jboss.org/file-access/default/members/resteasy/freezone/docs/1.0-= beta-7/userguide/html/JAX-RS_Resource_Locators_and_Sub_Resources.html > If there are some assumed limitation please provide workarounds for dynam= ic subresources. > (Side note: effective behavior is very similar to CXF-1762 suffering from= method dispatching problems; maybe solution is similar). --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.