You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Santosh Kulkarni <ku...@gmail.com> on 2013/09/26 23:19:28 UTC

CXF with Spring context that is programmatically started

I am trying to write a CXF web service as part of my spring based
application.

For reasons beyond my control we programmatically start the Spring context
so I can't let CXF start it.
I load the cfx-beans.xml with all of my other spring configuration files
and it even starts the web service.

The problem is that the CXF servlet does not know about it so the /services
URL says there are no services defined. SO the web service is not exposed.

Can I start the spring context and somehow 'tell' CXF what the context is?

Santosh

Re: CXF with Spring context that is programmatically started

Posted by Santosh Kulkarni <ku...@gmail.com>.
I am using tomcat. So, no jetty.
Santosh


On Thu, Sep 26, 2013 at 5:35 PM, Johan Edstrom <se...@gmail.com> wrote:

> Are you starting in a servlet context or do you want cxf to start a jetty
> container?
>
> Sent from my pressure cooker.
>
> On Sep 26, 2013, at 15:19, Santosh Kulkarni <ku...@gmail.com> wrote:
>
> > I am trying to write a CXF web service as part of my spring based
> > application.
> >
> > For reasons beyond my control we programmatically start the Spring
> context
> > so I can't let CXF start it.
> > I load the cfx-beans.xml with all of my other spring configuration files
> > and it even starts the web service.
> >
> > The problem is that the CXF servlet does not know about it so the
> /services
> > URL says there are no services defined. SO the web service is not
> exposed.
> >
> > Can I start the spring context and somehow 'tell' CXF what the context
> is?
> >
> > Santosh
>



-- 
Contentment is not the fulfillment of what
you want, but the realization of how much
you already have.

Re: CXF with Spring context that is programmatically started

Posted by Johan Edstrom <se...@gmail.com>.
Are you starting in a servlet context or do you want cxf to start a jetty container?

Sent from my pressure cooker.

On Sep 26, 2013, at 15:19, Santosh Kulkarni <ku...@gmail.com> wrote:

> I am trying to write a CXF web service as part of my spring based
> application.
> 
> For reasons beyond my control we programmatically start the Spring context
> so I can't let CXF start it.
> I load the cfx-beans.xml with all of my other spring configuration files
> and it even starts the web service.
> 
> The problem is that the CXF servlet does not know about it so the /services
> URL says there are no services defined. SO the web service is not exposed.
> 
> Can I start the spring context and somehow 'tell' CXF what the context is?
> 
> Santosh

Re: CXF with Spring context that is programmatically started

Posted by Santosh Kulkarni <ku...@gmail.com>.
Thanks, now I have to figure out how to make my cxf servlet aware of my
spring context.
Santosh
On Sep 27, 2013 4:17 AM, "Sergey Beryozkin" <sb...@gmail.com> wrote:

> Try extending CXFServlet and overriding its
> protected loadBus(...) method, the default implementation loads a context
> itself and the does
>
> super.setBus(**applicationContext.getBean("**cxf"));
>
> where 'cxf' is the name of Spring loaded bus,
> may be you can do something similar in your case, set a bus from the
> spring context loaded out-of-band
>
> Sergey
>
>
> On 26/09/13 22:19, Santosh Kulkarni wrote:
>
>> I am trying to write a CXF web service as part of my spring based
>> application.
>>
>> For reasons beyond my control we programmatically start the Spring context
>> so I can't let CXF start it.
>> I load the cfx-beans.xml with all of my other spring configuration files
>> and it even starts the web service.
>>
>> The problem is that the CXF servlet does not know about it so the
>> /services
>> URL says there are no services defined. SO the web service is not exposed.
>>
>> Can I start the spring context and somehow 'tell' CXF what the context is?
>>
>> Santosh
>>
>>
>

Re: CXF with Spring context that is programmatically started

Posted by Sergey Beryozkin <sb...@gmail.com>.
Try extending CXFServlet and overriding its
protected loadBus(...) method, the default implementation loads a 
context itself and the does

super.setBus(applicationContext.getBean("cxf"));

where 'cxf' is the name of Spring loaded bus,
may be you can do something similar in your case, set a bus from the 
spring context loaded out-of-band

Sergey


On 26/09/13 22:19, Santosh Kulkarni wrote:
> I am trying to write a CXF web service as part of my spring based
> application.
>
> For reasons beyond my control we programmatically start the Spring context
> so I can't let CXF start it.
> I load the cfx-beans.xml with all of my other spring configuration files
> and it even starts the web service.
>
> The problem is that the CXF servlet does not know about it so the /services
> URL says there are no services defined. SO the web service is not exposed.
>
> Can I start the spring context and somehow 'tell' CXF what the context is?
>
> Santosh
>