You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christopher Cheng <ch...@gmail.com> on 2009/08/23 13:06:45 UTC

No resource methods found for resource class 'demo.restful.server.CustomerServiceImpl'

I am trying to run the sample "restful_http_binding" included using
cxf-2.2.3 (the latest version)
  It has the same old problem again?? How do I solve it?

The following is the cxf.xml

<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:cxf="http://cxf.apache.org/core" xmlns:jaxrs="
http://cxf.apache.org/jaxrs"
       xsi:schemaLocation="http://cxf.apache.org/core
        http://cxf.apache.org/schemas/core.xsd
        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">

    <import resource="classpath*:META-INF/cxf/cxf-extension-*.xml" />
    <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" />

    <jaxrs:server id="customerService">
        <jaxrs:serviceBeans>
            <ref bean="customerBean"/>
        </jaxrs:serviceBeans>
    </jaxrs:server>
    <bean id="customerBean"
class="demo.restful.server.CustomerServiceImpl"/>

</beans>


[18:59:49.140] {main} LOAD_BUS_WITHOUT_APPLICATION_CONTEXT
[18:59:51.250] {main} No resource methods found for resource class
demo.restful.server.CustomerServiceImpl
[18:59:51.296] {main} Initial attempt to crate application context was
unsuccessful.
[18:59:51.296] {main}
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'customerService': Invocation of init method failed; nested
exception is org.apache.cxf.service.factory.ServiceConstructionException
[18:59:51.296] {main} Caused by:
org.apache.cxf.service.factory.ServiceConstructionException
[18:59:51.296] {main}  at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:113)
[18:59:51.296] {main}  at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:59:51.296] {main}  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[18:59:51.296] {main}  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[18:59:51.296] {main}  at java.lang.reflect.Method.invoke(Method.java:597)

Re: No resource methods found for resource class 'demo.restful.server.CustomerServiceImpl'

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

restful_http_binding shows how the deprecated CXF HTTP Binding can be used.
Are you sure you're running this demo ?

cheers, Sergey

Christopher Cheng wrote:
> 
> I am trying to run the sample "restful_http_binding" included using
> cxf-2.2.3 (the latest version)
>   It has the same old problem again?? How do I solve it?
> 
> The following is the cxf.xml
> 
> <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:cxf="http://cxf.apache.org/core" xmlns:jaxrs="
> http://cxf.apache.org/jaxrs"
>        xsi:schemaLocation="http://cxf.apache.org/core
>         http://cxf.apache.org/schemas/core.xsd
>         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">
> 
>     <import resource="classpath*:META-INF/cxf/cxf-extension-*.xml" />
>     <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" />
> 
>     <jaxrs:server id="customerService">
>         <jaxrs:serviceBeans>
>             <ref bean="customerBean"/>
>         </jaxrs:serviceBeans>
>     </jaxrs:server>
>     <bean id="customerBean"
> class="demo.restful.server.CustomerServiceImpl"/>
> 
> </beans>
> 
> 
> [18:59:49.140] {main} LOAD_BUS_WITHOUT_APPLICATION_CONTEXT
> [18:59:51.250] {main} No resource methods found for resource class
> demo.restful.server.CustomerServiceImpl
> [18:59:51.296] {main} Initial attempt to crate application context was
> unsuccessful.
> [18:59:51.296] {main}
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'customerService': Invocation of init method failed; nested
> exception is org.apache.cxf.service.factory.ServiceConstructionException
> [18:59:51.296] {main} Caused by:
> org.apache.cxf.service.factory.ServiceConstructionException
> [18:59:51.296] {main}  at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:113)
> [18:59:51.296] {main}  at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [18:59:51.296] {main}  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [18:59:51.296] {main}  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [18:59:51.296] {main}  at java.lang.reflect.Method.invoke(Method.java:597)
> 
> 

-- 
View this message in context: http://www.nabble.com/No-resource-methods-found-for-resource-class-%27demo.restful.server.CustomerServiceImpl%27-tp25102248p25107027.html
Sent from the cxf-user mailing list archive at Nabble.com.