cxf-users mailing list archives

Hi all,
This is priya, I am using CFX for my application.
I have successfully implemented the CXF, now i hav to go in for the HTTP
Binding for RESTful service.
I just followed the steps below and also the CXF document.
This is my config 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"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<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-servlet.xml" />
<jaxws:endpoint
id="customer"
implementor="sg.sphsearch.sfe.webService.server.CustomerServiceImpl"
address="/Customer"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<bean id="JaxWsServiceFactoryBean"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="wrapped" value="false"/>
</bean>
</jaxws:serviceFactory>
</jaxws:endpoint>
</beans>
This is my client bean
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
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/schema/jaxws.xsd">
<bean id="client" class="sg.server.Customer"
factory-bean="clientFactory" factory-method="create" >
</bean>
<bean id="clientFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="sg.server.Customer"/>
<property name="address"
value="http://localhost:8080/sfe/Customer"/>
</bean>
</beans>
i am getting the following error, can you help me in solving this
2007-12-07 09:55:11,568 ERROR org.springframework.web.context.ContextLoader
- Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'customer': Invocation of init method failed; nested exception is
org.apache.cxf.service.factory.ServiceConstructionException: Could not
resolve a binding for http://apache.org/cxf/binding/http
Caused by:
org.apache.cxf.service.factory.ServiceConstructionException: Could not
resolve a binding for http://apache.org/cxf/binding/http
at
org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo(AbstractEndpointFactory.java:302)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:137)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:179)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:287)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
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:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.apache.cxf.BusException: No binding factory for namespace
http://apache.org/cxf/binding/http registered.
at
org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:78)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo(AbstractEndpointFactory.java:297)
... 41 more
Dec 7, 2007 9:55:11 AM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'customer': Invocation of init method failed; nested exception is
org.apache.cxf.service.factory.ServiceConstructionException: Could not
resolve a binding for http://apache.org/cxf/binding/http
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not resolve a binding for http://apache.org/cxf/binding/http
at
org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo(AbstractEndpointFactory.java:302)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:137)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:179)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:287)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
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:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.apache.cxf.BusException: No binding factory for namespace
http://apache.org/cxf/binding/http registered.
at
org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:78)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo(AbstractEndpointFactory.java:297)
... 41 more
Can any one guide me how to proceed.
I am very new to this technology.
Thanks in advance.
--
View this message in context: http://www.nabble.com/HTTP-Binding-for-RESTful-service-tf4959859.html#a14205556
Sent from the cxf-user mailing list archive at Nabble.com.