You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Frank Ittermann (JIRA)" <ji...@apache.org> on 2008/08/22 11:20:44 UTC

[jira] Created: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

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.


Re: [jira] Created: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by sylvek <sm...@gmail.com>.
hi,
i have the same issue :-/

cxf => 2.1.2
jsr-311 => 0.8
tomcat => 6.0.14
java => 1.5.0_10


JIRA jira@apache.org wrote:
> 
> 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.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Created%3A-%28CXF-1762%29-The-JAXRS-mapping-of-Java-methods-without-method-parameter-not-working.-tp19104011p19308998.html
Sent from the cxf-issues mailing list archive at Nabble.com.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640586#action_12640586 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Frank,

can you please confirm it's still an issue with 2.1.2 ?

I can't confirm it.

Here's my test case.

1. Server impl

@Path("/bookstore/")
public class BookStoreSpring {

    private Map<Long, Book> books = new HashMap<Long, Book>();
    private Long mainId = 123L;
        
    public BookStoreSpring() {
        init();
        System.out.println("----books: " + books.size());
    }
    
    @GET
    @Path("/books/{id}")
    @ProduceMime("application/json")
    public Book getBookById(@PathParam("id") Long id) {
        return books.get(id);
    }

    @GET
    @ProduceMime("application/json")
    public Book getDefaultBook() {
        return books.get(mainId);
    }

    
    // init()
}

this is equivalent to the class sample you provided, just the names are different.

2. beans.xml

<jaxrs:server id="bookservice"
address="/">
    <jaxrs:serviceBeans>
      <bean class="org.apache.cxf.systest.jaxrs.BookStoreSpring" />
    </jaxrs:serviceBeans>
  </jaxrs:server>

The server is started ok , both methods can be executed

The only difference is that Jetty is used....

> 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's.
> @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.


[jira] Assigned: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin reassigned CXF-1762:
-------------------------------------

    Assignee: Sergey Beryozkin

> 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
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650209#action_12650209 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Here's what I have. Slightly simplified PlayerService :

@Path("/player/{uuid}/")
@Produces("application/json")
public class PlayerService {

    // instead of ConcurrentMap, just to tp have some property set on a root  resource class from Spring
    public void setProperty(String value) {
    }
    
    @GET
    @Path("/error")
    public String getError(@PathParam("uuid") String uuid) {
        return "little problem";
    }

    @GET
    @Path("/fatal")
    public String getFatal(@PathParam("uuid") String uuid) {
        return "big problem";
    }

    @GET
    @Path("/state")
    public String getState(@PathParam("uuid") String uuid) {
        return "ok";
    }

}

same web.xml, and this beans.xml :

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:jaxrs="http://cxf.apache.org/jaxrs"
  xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd" default-lazy-init="true">

  <import resource="classpath:META-INF/cxf/cxf.xml" />
  <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
  <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
  
  <bean id="PlayerService" class="org.apache.cxf.systest.jaxrs.PlayerService">
     <property name="property" value="property"/>
  </bean>

  <jaxrs:server id="bookservice"
		        address="/">
    <jaxrs:serviceBeans>
      <ref bean="PlayerService"/>
    </jaxrs:serviceBeans>		   
  </jaxrs:server>

</beans>

With Tomcat 5.5.25 and cxf-fuse 2.1.2 (certified CXF, but the jaxrs code is the same there) I see no problems at all starting the web application.

Can you give me a favor and remove @NullCheck annotations and if it changes anything ? Likewsie can you temporarily comment out everything but jaxrs related definitions
in your bean and give it a try ?



> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651859#action_12651859 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Hi Frank - good news and thanks for taking your time and verifying this issue has been fixed,  at least for your project. I'd happy to close this issue, 
but sylvek  saw this issue too - though I can't confirm it - I do hope that may be I'll be able to close this issue soon enough :-)    

> 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
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651734#action_12651734 ] 

Frank Ittermann commented on CXF-1762:
--------------------------------------

Hy Sergey,

sorry for the long delay but i was also very busy the christmas business has started.
I attached a little rest project that i used to reproduce the issue.

The good news is that this issue is fixed in the 2.1.3 and 2.1.2 version.
I tested this with the apache tomcat version 6.0.18.

I remember that this issue occurs in 2.1.3-SNAPSHOT version before 22.08.08 I guess.

So good work it's fixed.

> 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
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Updated: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Ittermann updated CXF-1762:
---------------------------------

    Attachment: zxapp_rest_test.zip

Here is a sample maven project to reproduce the error.

> 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
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Resolved: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-1762.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2
                   2.1.4

> 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
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 2.1.4, 2.2
>
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "sylvek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645622#action_12645622 ] 

sylvek commented on CXF-1762:
-----------------------------

same issu with cxf 2.1.3 :'(

7 nov. 2008 00:45:17 org.apache.cxf.jaxrs.JAXRSServiceFactoryBean checkMethodDispatcher
ATTENTION: No resource methods found for resource class org.apache.cxf.jaxrs.model.ClassResourceInfo
INFO  DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1bfc9d: defining beans [cxf,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.jaxrs.JAXRSBindingFactory,org.apache.cxf.transport.servlet.ServletTransportFactory,PlayerService,PlayerRestService,GameService,GameRestService,GameFindService,GameFindRestService,GamePlayerService,GamePlayerRestService,GameAdminService,GameAsminRestService,PlayerAdminService,PlayerAdminRestService,RegistrationService,RegistrationRestService,ActionService,ActionRestService,BetService,BetRestService,Players,Games,UidService,ConfigurationService,Rules,RefreshGamble,DistributeCards,ThePreFlop,ThePreFlopActionsState,TheDefaultActionsState,TheFlop,TheTurn,TheRiver,TheShutdown,ThePot,ShowTheWinners,MakeABreak,Croupier,PotManager,NotNullInterceptor,org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator,LoggerInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator,TaskExecutor,GameThreadFactory]; root of factory hierarchy
ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PlayerRestService': 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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641443#action_12641443 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Frank - I'd appreciate if you could get back to me on this issue...

> 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's.
> @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.


[jira] Updated: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Ittermann updated CXF-1762:
---------------------------------

    Description: 
Hello everybody,

I implemented a REST resource that has a java method without method parameter's.
@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)


  was:
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)



> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "sylvek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643268#action_12643268 ] 

sylvek commented on CXF-1762:
-----------------------------

i confirm this issue :-/

i have the same problem under tomcat (6.0.14) and with CXF 2.1.2.

i use in the same "service" function with and without paramters.

> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650214#action_12650214 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Frank : I tried this code again (by hacking a bit a PlayerService code but it matched one to one the code you posted originally)

@Path("/player/")
@Produces("application/json")
@Consumes("application/json")
public class PlayerService {
    
    @GET
    @Path("/id/{id}")
    public String getSomeThingElse(@PathParam("id")int id) {
        return new String("bar");
    }

    @GET
    public String getSomeThing() {
        return "something";
    } 

}

Both methods can be successfully invoked

> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628335#action_12628335 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

I'll try to fix it by the end of next week...

> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "sylvek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645620#action_12645620 ] 

sylvek commented on CXF-1762:
-----------------------------

tested with cxf 2.1.2:

my PlayerRestService:

@Path("/player/{uuid}/")
@ProduceMime("application/json")
public class PlayerServiceDefault extends AbstractService implements
		PlayerService {

	private ConcurrentMap<String, AsyncPlayer> players;

	public void setPlayers(ConcurrentMap<String, AsyncPlayer> players) {
		this.players = players;
	}

	@GET
	@Path("/error")
	@NotNullChecker
	public String getError(@PathParam("uuid") String uuid) throws BusinessException {
		return getPlayer(uuid).getLastError().getMessage();
	}
	
	@GET
	@Path("/fatal")
	@NotNullChecker
	public String getFatal(@PathParam("uuid") String uuid) throws BusinessException {
		return getPlayer(uuid).getFatal().getMessage();
	}

	@GET
	@Path("/state")
	@NotNullChecker
	public String getState(@PathParam("uuid") String uuid) throws BusinessException {
		return getPlayer(uuid).getCurrentState().value();
	}
}

my app-context file:
beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xsi:schemaLocation="
	http://www.springframework.org/schema/beans 
	http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
	http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
	http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"
	default-lazy-init="true">
	<import resource="classpath:META-INF/cxf/cxf.xml" />
<!--	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />-->
	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	<bean id="PlayerService" class="fr.sokaris.poker.services.impl.PlayerServiceDefault">
		<property name="players">
			<ref bean="Players" />
		</property>
	</bean>
	<jaxrs:server id="PlayerRestService" address="/rest/">
		<jaxrs:serviceBeans>
			<ref bean="PlayerService" />
		</jaxrs:serviceBeans>
	</jaxrs:server>
<!--	<jaxws:endpoint id="PlayerWebService" implementor="#PlayerService"-->
<!--		implementorClass="fr.sokaris.poker.services.impl.PlayerServiceDefault"-->
<!--		address="/PlayerService" />-->

my web.xml file :
<servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>

and my error :
7 nov. 2008 00:35:28 org.apache.cxf.jaxrs.JAXRSServiceFactoryBean checkMethodDispatcher
ATTENTION: No resource methods found for resource class org.apache.cxf.jaxrs.model.ClassResourceInfo
INFO  DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1bfc9d: defining beans [cxf,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.jaxrs.JAXRSBindingFactory,org.apache.cxf.transport.servlet.ServletTransportFactory,PlayerService,PlayerRestService,GameService,GameRestService,GameFindService,GameFindRestService,GamePlayerService,GamePlayerRestService,GameAdminService,GameAsminRestService,PlayerAdminService,PlayerAdminRestService,RegistrationService,RegistrationRestService,ActionService,ActionRestService,BetService,BetRestService,Players,Games,UidService,ConfigurationService,Rules,RefreshGamble,DistributeCards,ThePreFlop,ThePreFlopActionsState,TheDefaultActionsState,TheFlop,TheTurn,TheRiver,TheShutdown,ThePot,ShowTheWinners,MakeABreak,Croupier,PotManager,NotNullInterceptor,org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator,LoggerInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator,TaskExecutor,GameThreadFactory]; root of factory hierarchy
ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PlayerRestService': 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 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:585)


> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653951#action_12653951 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

I reproduced it while messing with spring security - which is good

> 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
>         Attachments: zxapp_rest_test.zip
>
>
> Hello everybody,
> I implemented a REST resource that has a java method without method parameter's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Frank Ittermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644026#action_12644026 ] 

Frank Ittermann commented on CXF-1762:
--------------------------------------

Sorry about the delay.

I will check if the bug is still present in the next day on the 2.1.2 and 2.1.3 version.

please forgive me Sergey. :-)

> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644700#action_12644700 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Hi sylvek (using your login name :-)) - thanks for the confirmation - can you please post here the sample code (the sample resource class with annotations and methods) plus the spring config, plus the URI request which results in a no method found error ? Did you try 2.1.3 ?

Hi Frank - no problems at all - please try it when you get a chance. If it still fails then please check that the sample resource class you posted above is indeed matching the one you're using and please also post the spring config. May be 2.1.3 will fix it ?

thanks

> 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's.
> @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.


[jira] Commented: (CXF-1762) The JAXRS mapping of Java methods without method parameter not working.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645726#action_12645726 ] 

Sergey Beryozkin commented on CXF-1762:
---------------------------------------

Ok - I'll look at this issue asap - I'm a bit busy with the other work at the moment but I'll do my best to get it fixed for 2.1.4

> 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's.
> @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.