cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Basic JAX-RS Service
Date Fri, 27 Jun 2014 21:07:32 GMT
Hi
On 27/06/14 17:51, Chris Bud wrote:
> Hi All,
>
> I'm trying to build a basic jax-rs example using version 2.7.11.  Using the
> server and service code from the example code
> <http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/>,
> I can build and run it just like the readme instructions say (mvn -Pserver)
> but if I produce a jar bundled with the dependencies and run from the
> command line I cannot get the server to start.  I get the following
> exception
>
> test-service/target$ java -cp test-service-1.0-jar-with-dependencies.jar
> com.test.Server
> Exception in thread "main"
> org.apache.cxf.service.factory.ServiceConstructionException
> at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:190)
> at com.test.Server.<init>(Server.java:24)
> at com.test.Server.main(Server.java:29)
> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for
> the namespace http://cxf.apache.org/transports/http.
> at
> org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:130)
> at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:78)
> at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:62)
> at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:151)
> ... 2 more
>
> Can anyone point me in the right direction?
>
It appears that when running a packaged Jetty based demo the following 
has to be done:

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring

Please see the lines related to registering binding id/factory

Can you please update Server accordingly, recompile and retry ?

Cheers, Sergey

> Thanks,
> Chris
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Mime
View raw message