Hi I was planning to write a test, just didn't get a chance yet, sorry. Now that you mentioned Jetty, I think may be the trick is to import jetty transport, rather that the servlet one, so instead of
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> You should do <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" /> Can you try it please ? Cheers, Sergey -----Original Message----- From: Eugeny N Dzhurinsky [mailto:[email protected]] Sent: 16 June 2009 21:17 To: [email protected] Subject: Re: Configure CXF JAXRS services in the Spring context andstand-aloneusage On Tue, Jun 16, 2009 at 09:56:39AM +0100, Sergey Beryozkin wrote: > Not sure why but the message formatting is broken > Here's another attempt : > > ClassPathXmlApplicationContext ctx = > new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxrs/spring/servers.xml"}); > > // 'simple' is the id of the jaxrs server bean > JAXRSServerFactoryBean sfb = (JAXRSServerFactoryBean)ctx.getBean("simple"); > sfb.create(); > > or may be you just can get all the beans from the context and call create() on those which are assignable to JAXRSServerFactoryBean > > give a try please > > Cheers, Sergey Also I noticed if the following line of code ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/beans.xml"); appears in the Java class aimed to start up the things, the call to the JAXRSServerFactoryBean() sfb = new JAXRSServerFactoryBean(); sfb.setAddress("..."); sfb.create(); does not start the internal Jetty server. Commenting out the context loading does the trick. So is it possible the jaxrs:server tag needs to be configured somehow with the transport or something like this? -- Eugene N Dzhurinsky
