Leaving CXF for Glasshfish Metro
Hi, After spending about 2 weeks trying to get a very simple service to return JSON in CXF, I found the Glassfish Metro project and it's jaxws-json plugin. I gave it a shot and after 2 hours had my service up and running. Not only that, but the plugin generates pretty api docs at the endpoint for me as well as generates a javascript client on the fly. It was just too easy to make me stick with CXF. I think CXF is probably a good framework, but the docs and examples are in pieces and without real life end-to-end tutorials, it's really hard to get things working. - Jonathan
wrapped=false breaks spring config
Hi, I'm trying to get a simple JSON service running. For now, I'm just simply getting http_binding working with spring. It works fine with wrapped=true but ass soon as i set wrapped to false, I get an Invocation of init method failed (NullPointer). Here's my 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:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.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-servlet.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-extension-http-binding.xml / import resource=classpath:META-INF/cxf/cxf-extension-xml.xml / bean id=geoImpl class=my.package.GeoCodeImpl autowire=constructor /bean jaxws:endpoint id=geocodeService address=/json/geocode implementor=#geoImpl bindingUri=http://apache.org/cxf/binding/http; jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false / /bean /jaxws:serviceFactory /jaxws:endpoint /beans my Service Interface: --- @WebService public interface GeoCode { @Get @HttpResource(location=/{location}) @WebResult(name = GeoCodeResponse) public GeoCodeResponse geoCode(@WebParam(name=location) String location); } my IMPL: @WebService(endpointInterface = my.package.GeoCode) public class GeoCodeImpl implements GeoCode { public GeoCodeImpl( ){ } @Override public GeoCodeResponse geoCode(String location) { .. i do stuff here ... return r; } } the error: 2008-01-21 11:48:07.175::WARN: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geocodeService': Invocation of init method failed; nested exception is java.lang.NullPointerException: [java] java.lang.NullPointerException [java] at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createBareMessage(ReflectionServiceFactoryBean.java:692) [java] at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:308) [java] at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:333) [java] at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:151) [java] at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:93) [java] at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74) [java] at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108) [java] at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147) [java] at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288) [java] at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228) [java] at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) [java] at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:597) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208) [java] at
java 6 jar removals
Hi, I'm using java 6 and was wondering what (if any) jars I can remove from my libs when using cxf? It seems I can remove the following and everything still compiles: jaxws-api.jar saaj-api.jar jaxb-api.jar jaxb-impl.jar stax-api.jar is this correct? anything else? - Jonathan