Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 65133 invoked from network); 22 Aug 2008 09:21:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Aug 2008 09:21:05 -0000 Received: (qmail 77510 invoked by uid 500); 22 Aug 2008 09:21:03 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 77493 invoked by uid 500); 22 Aug 2008 09:21:03 -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 77482 invoked by uid 99); 22 Aug 2008 09:21:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2008 02:21:03 -0700 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; Fri, 22 Aug 2008 09:20:15 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 61982234C1C2 for ; Fri, 22 Aug 2008 02:20:44 -0700 (PDT) Message-ID: <1892485101.1219396844398.JavaMail.jira@brutus> Date: Fri, 22 Aug 2008 02:20:44 -0700 (PDT) From: "Frank Ittermann (JIRA)" To: issues@cxf.apache.org Subject: [jira] Created: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org The JAXRS mapping of Java methods without method parameter not working. ----------------------------------------------------------------------- Key: CXF-1762 URL: https://issues.apache.org/jira/browse/CXF-1762 Project: CXF Issue Type: Bug Components: Resources Affects Versions: 2.1.2 Environment: Windows XP, jdk 1.6.0_07 Reporter: Frank Ittermann Priority: Minor Hello everybody, I implemented a REST resource that has a java method without method parameter. @Path("/service") @ConsumeMime({ "application/json;charset=UTF-8", "application/xml;charset=UTF-8" }) @ProduceMime({ "application/json;charset=UTF-8", "application/xml;charset=UTF-8" }) public class RestService { @GET @Path("/id/{id}") public SomeThingElse getSomeThingElse(@PathParam("id")int id) { return new SomeThingElse(); } @GET public SomeThing getSomeThing() { return new SomeThing(); } } If you call the rest uri /service the following error occur SCHWERWIEGEND: .No operation matching request path /adspaces/ is found, ContentT ype : */*, Accept : text/xml,application/xml,application/xhtml+xml,text/html;q=0 .9,text/plain;q=0.8,image/png,*/*;q=0.5. I changed the method getSomeThing and add a method parameter than it works. any suggestions And a other strange behavior is if you remove the method getSomeThingElse from the code than an error by creating the service occur. Here the error log: ERROR main org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlserviceserver': 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 Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClassesFromBeans(JAXRSServiceFactoryBean.java:144) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(JAXRSServerFactoryBean.java:265) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(JAXRSServerFactoryBean.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:821) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:862) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.