You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@progress.com> on 2009/06/16 22:39:32 UTC
RE: Configure CXF JAXRS services in the Spring context andstand-aloneusage
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:bofh@redwerk.com]
Sent: 16 June 2009 21:17
To: users@cxf.apache.org
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
Re: Configure CXF JAXRS services in the Spring context
andstand-aloneusage
Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Tue, Jun 16, 2009 at 04:39:32PM -0400, Sergey Beryozkin wrote:
> 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 ?
Hello, Sergey!
That worked, thank you! Now Jetty starts just fine. Thanks again!
--
Eugene N Dzhurinsky