You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Oliver Wulff <ow...@progress.com> on 2009/10/19 22:57:30 UTC

Use of OSGi http service instead of jetty engine

Hi there
 
When a customer deploys several applications into an osgi container (servicemix 4.x) each bundle configures/(instantiates) a jetty engine with security configurations etc. An idea is to re-use the osgi http service. Is this possible? Somehow, the osgi http service must know under which circumstances the request should be dispatched to cxf.
 
Thanks
Oliver

Re: Use of OSGi http service instead of jetty engine

Posted by Sergey Beryozkin <sb...@progress.com>.
There will be some JAXRS commits going in the next couple of weeks, in time for 2.1.5, so I'll be doing some docs updates, and I 
will do the OSGI transport page as well

cheers, Sergey

>
>
> We probably should have a child page of:
> http://cxf.apache.org/docs/transports.html
>
> that at least briefly describes the OSGI transport.  The stuff about the
> context changing is specific to the CXF transport and could/should be
> described at cxf.   That could apply to any OSGi runtime.
>
> The port number stuff is definitely a smx thing, but mentioning it in our docs
> would also be good.
>
> Dan
>
>
> On Thu October 22 2009 9:51:14 am Sergey Beryozkin wrote:
>> Sounds like a good idea. Can you please open a ServiceMix4 JIRA ? Or post
>>  this suggestion to the service mix users list ?
>>
>> I've updated ReadMe(s) for demos like cfx-osgi and cxf-jaxrs, but I didn't
>>  get to updating the ServiceMix wiki.
>>
>> By the way you can also edit the alias by using the shell config commands,
>>  for example : config:edit org.apache.cxf.osgi
>>    config:propset org.apache.cxf.servlet.context /super
>>    config:update
>>
>> (perhaps using some OSGI ConfigService WEB tool - I'm not aware of any
>>  though)
>>
>> cheers, Sergey
>>
>> ----- Original Message -----
>> From: "Jaime Hablutzel Egoavil" <ha...@gmail.com>
>> To: <us...@cxf.apache.org>
>> Sent: Thursday, October 22, 2009 2:37 PM
>> Subject: Re: Use of OSGi http service instead of jetty engine
>>
>> > Thank you Sergey, I got it working with your advice, do you think it
>> > should be added to the project wiki? or is it already there?
>> >
>> > On Thu, Oct 22, 2009 at 4:25 AM, Sergey Beryozkin
> <sb...@progress.com>wrote:
>> >> Hi
>> >>
>> >> For changing the port please update etc/system.properties  (sorry, not
>> >> etc/config.properties):
>> >>
>> >> org.osgi.service.http.port=9090
>> >>
>> >> 'cxf' context :
>> >>
>> >>  You can add an
>> >>
>> >>>> org.apache.cxf.osgi.cfg to /etc directory and set the
>> >>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and
>> >>>> it will be used instead of 'cxf'.
>> >>
>> >> cheers, Sergey
>> >>
>> >>> Hi Sergey, what exactly should be added to etc/config.properties to
>> >>> change cxf context and 8181 port??
>> >>>
>> >>> Sergey Beryozkin-2 wrote:
>> >>>> Starting with 2.2.4 it is also possible to configure an alias for the
>> >>>> CXF servlet.
>> >>>> Example :
>> >>>>
>> >>>>  For the most part, in the spring config, instead of importing
>> >>>>
>> >>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>> >>>>> you would import
>> >>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>> >>>>>
>> >>>>> The "address" used on jaxws:endpoint and such would just be:
>> >>>>>
>> >>>>> /blah
>> >>>>>
>> >>>>> with no http://host:port type thing.
>> >>>>
>> >>>> would result in http://host:8181/cxf/blah URI being support but a
>> >>>> given jaxws or jaxrs endpoint.
>> >>>>
>> >>>> Port '8181' can be changed in the etc/config.properties. You can add
>> >>>> an org.apache.cxf.osgi.cfg to /etc directory and set the
>> >>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and
>> >>>> it will be used instead of 'cxf'. This property can also be configured
>> >>>> using shell config commands and indeed the changes can be
>> >>>> persisted and restored after the restart  with the latest Karaf fix
>> >>>> from Guilluame.
>> >>>>
>> >>>> cheers, Sergey
>> >>>>
>> >>>>  On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>> >>>>>> Hi there
>> >>>>>>
>> >>>>>> When a customer deploys several applications into an osgi container
>> >>>>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty
>> >>>>>> engine with
>> >>>>>>  security configurations etc. An idea is to re-use the osgi http
>> >>>>>> service.
>> >>>>>>  Is this possible? Somehow, the osgi http service must know under
>> >>>>>> which circumstances the request should be dispatched to cxf.
>> >>>>>
>> >>>>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http
>> >>>>> transport for cxf
>> >>>>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we
>> >>>>> moved that
>> >>>>> code into cxf where we can maintain it better.
>> >>>>>
>> >>>>> For the most part, in the spring config, instead of importing
>> >>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>> >>>>> you would import
>> >>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>> >>>>>
>> >>>>> The "address" used on jaxws:endpoint and such would just be:
>> >>>>>
>> >>>>> /blah
>> >>>>>
>> >>>>> with no http://host:port type thing.
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Daniel Kulp
>> >>>>> dkulp@apache.org
>> >>>>> http://www.dankulp.com/blog
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>> http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-
>> >>>tp25965535p25998548.html Sent from the cxf-user mailing list archive at
>> >>> Nabble.com.
>>
>
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog 


Re: Use of OSGi http service instead of jetty engine

Posted by Daniel Kulp <dk...@apache.org>.

We probably should have a child page of:
http://cxf.apache.org/docs/transports.html

that at least briefly describes the OSGI transport.  The stuff about the 
context changing is specific to the CXF transport and could/should be 
described at cxf.   That could apply to any OSGi runtime.

The port number stuff is definitely a smx thing, but mentioning it in our docs 
would also be good.

Dan


On Thu October 22 2009 9:51:14 am Sergey Beryozkin wrote:
> Sounds like a good idea. Can you please open a ServiceMix4 JIRA ? Or post
>  this suggestion to the service mix users list ?
> 
> I've updated ReadMe(s) for demos like cfx-osgi and cxf-jaxrs, but I didn't
>  get to updating the ServiceMix wiki.
> 
> By the way you can also edit the alias by using the shell config commands,
>  for example : config:edit org.apache.cxf.osgi
>    config:propset org.apache.cxf.servlet.context /super
>    config:update
> 
> (perhaps using some OSGI ConfigService WEB tool - I'm not aware of any
>  though)
> 
> cheers, Sergey
> 
> ----- Original Message -----
> From: "Jaime Hablutzel Egoavil" <ha...@gmail.com>
> To: <us...@cxf.apache.org>
> Sent: Thursday, October 22, 2009 2:37 PM
> Subject: Re: Use of OSGi http service instead of jetty engine
> 
> > Thank you Sergey, I got it working with your advice, do you think it
> > should be added to the project wiki? or is it already there?
> >
> > On Thu, Oct 22, 2009 at 4:25 AM, Sergey Beryozkin 
<sb...@progress.com>wrote:
> >> Hi
> >>
> >> For changing the port please update etc/system.properties  (sorry, not
> >> etc/config.properties):
> >>
> >> org.osgi.service.http.port=9090
> >>
> >> 'cxf' context :
> >>
> >>  You can add an
> >>
> >>>> org.apache.cxf.osgi.cfg to /etc directory and set the
> >>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and
> >>>> it will be used instead of 'cxf'.
> >>
> >> cheers, Sergey
> >>
> >>> Hi Sergey, what exactly should be added to etc/config.properties to
> >>> change cxf context and 8181 port??
> >>>
> >>> Sergey Beryozkin-2 wrote:
> >>>> Starting with 2.2.4 it is also possible to configure an alias for the
> >>>> CXF servlet.
> >>>> Example :
> >>>>
> >>>>  For the most part, in the spring config, instead of importing
> >>>>
> >>>>> META-INF/cxf/cxf-extension-http-jetty.xml
> >>>>> you would import
> >>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
> >>>>>
> >>>>> The "address" used on jaxws:endpoint and such would just be:
> >>>>>
> >>>>> /blah
> >>>>>
> >>>>> with no http://host:port type thing.
> >>>>
> >>>> would result in http://host:8181/cxf/blah URI being support but a
> >>>> given jaxws or jaxrs endpoint.
> >>>>
> >>>> Port '8181' can be changed in the etc/config.properties. You can add
> >>>> an org.apache.cxf.osgi.cfg to /etc directory and set the
> >>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and
> >>>> it will be used instead of 'cxf'. This property can also be configured
> >>>> using shell config commands and indeed the changes can be
> >>>> persisted and restored after the restart  with the latest Karaf fix
> >>>> from Guilluame.
> >>>>
> >>>> cheers, Sergey
> >>>>
> >>>>  On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
> >>>>>> Hi there
> >>>>>>
> >>>>>> When a customer deploys several applications into an osgi container
> >>>>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty
> >>>>>> engine with
> >>>>>>  security configurations etc. An idea is to re-use the osgi http
> >>>>>> service.
> >>>>>>  Is this possible? Somehow, the osgi http service must know under
> >>>>>> which circumstances the request should be dispatched to cxf.
> >>>>>
> >>>>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http
> >>>>> transport for cxf
> >>>>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we
> >>>>> moved that
> >>>>> code into cxf where we can maintain it better.
> >>>>>
> >>>>> For the most part, in the spring config, instead of importing
> >>>>> META-INF/cxf/cxf-extension-http-jetty.xml
> >>>>> you would import
> >>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
> >>>>>
> >>>>> The "address" used on jaxws:endpoint and such would just be:
> >>>>>
> >>>>> /blah
> >>>>>
> >>>>> with no http://host:port type thing.
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Daniel Kulp
> >>>>> dkulp@apache.org
> >>>>> http://www.dankulp.com/blog
> >>>
> >>> --
> >>> View this message in context:
> >>> http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-
> >>>tp25965535p25998548.html Sent from the cxf-user mailing list archive at
> >>> Nabble.com.
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Use of OSGi http service instead of jetty engine

Posted by Sergey Beryozkin <sb...@progress.com>.
Sounds like a good idea. Can you please open a ServiceMix4 JIRA ? Or post this suggestion to the service mix users list ?

I've updated ReadMe(s) for demos like cfx-osgi and cxf-jaxrs, but I didn't get to updating the ServiceMix wiki. 

By the way you can also edit the alias by using the shell config commands, for example :
   config:edit org.apache.cxf.osgi   
   config:propset org.apache.cxf.servlet.context /super
   config:update

(perhaps using some OSGI ConfigService WEB tool - I'm not aware of any though)

cheers, Sergey

----- Original Message ----- 
From: "Jaime Hablutzel Egoavil" <ha...@gmail.com>
To: <us...@cxf.apache.org>
Sent: Thursday, October 22, 2009 2:37 PM
Subject: Re: Use of OSGi http service instead of jetty engine


> Thank you Sergey, I got it working with your advice, do you think it should
> be added to the project wiki? or is it already there?
> 
> On Thu, Oct 22, 2009 at 4:25 AM, Sergey Beryozkin <sb...@progress.com>wrote:
> 
>> Hi
>>
>> For changing the port please update etc/system.properties  (sorry, not
>> etc/config.properties):
>>
>> org.osgi.service.http.port=9090
>>
>> 'cxf' context :
>>
>>  You can add an
>>>> org.apache.cxf.osgi.cfg to /etc directory and set the
>>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>>>> will be used instead of 'cxf'.
>>>>
>>>
>>
>> cheers, Sergey
>>
>>
>>
>>> Hi Sergey, what exactly should be added to etc/config.properties to change
>>> cxf context and 8181 port??
>>>
>>>
>>>
>>>
>>> Sergey Beryozkin-2 wrote:
>>>
>>>>
>>>> Starting with 2.2.4 it is also possible to configure an alias for the CXF
>>>> servlet.
>>>> Example :
>>>>
>>>>  For the most part, in the spring config, instead of importing
>>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>>>> you would import
>>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>>>
>>>>> The "address" used on jaxws:endpoint and such would just be:
>>>>>
>>>>> /blah
>>>>>
>>>>> with no http://host:port type thing.
>>>>>
>>>>
>>>> would result in http://host:8181/cxf/blah URI being support but a given
>>>> jaxws or jaxrs endpoint.
>>>>
>>>> Port '8181' can be changed in the etc/config.properties. You can add an
>>>> org.apache.cxf.osgi.cfg to /etc directory and set the
>>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>>>> will be used instead of 'cxf'. This property can also be configured using
>>>> shell config commands and indeed the changes can be
>>>> persisted and restored after the restart  with the latest Karaf fix from
>>>> Guilluame.
>>>>
>>>> cheers, Sergey
>>>>
>>>>  On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>>>>>
>>>>>> Hi there
>>>>>>
>>>>>> When a customer deploys several applications into an osgi container
>>>>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine
>>>>>> with
>>>>>>  security configurations etc. An idea is to re-use the osgi http
>>>>>> service.
>>>>>>  Is this possible? Somehow, the osgi http service must know under which
>>>>>>  circumstances the request should be dispatched to cxf.
>>>>>>
>>>>>
>>>>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport
>>>>> for cxf
>>>>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved
>>>>> that
>>>>> code into cxf where we can maintain it better.
>>>>>
>>>>> For the most part, in the spring config, instead of importing
>>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>>>> you would import
>>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>>>
>>>>> The "address" used on jaxws:endpoint and such would just be:
>>>>>
>>>>> /blah
>>>>>
>>>>> with no http://host:port type thing.
>>>>>
>>>>>
>>>>> --
>>>>> Daniel Kulp
>>>>> dkulp@apache.org
>>>>> http://www.dankulp.com/blog
>>>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp25965535p25998548.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
> 
> 
> -- 
> Jaime Hablutzel
> 
> (tildes omitidas intencionalmente) 9 8964 0369
>

Re: Use of OSGi http service instead of jetty engine

Posted by Jaime Hablutzel Egoavil <ha...@gmail.com>.
Thank you Sergey, I got it working with your advice, do you think it should
be added to the project wiki? or is it already there?

On Thu, Oct 22, 2009 at 4:25 AM, Sergey Beryozkin <sb...@progress.com>wrote:

> Hi
>
> For changing the port please update etc/system.properties  (sorry, not
> etc/config.properties):
>
> org.osgi.service.http.port=9090
>
> 'cxf' context :
>
>  You can add an
>>> org.apache.cxf.osgi.cfg to /etc directory and set the
>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>>> will be used instead of 'cxf'.
>>>
>>
>
> cheers, Sergey
>
>
>
>> Hi Sergey, what exactly should be added to etc/config.properties to change
>> cxf context and 8181 port??
>>
>>
>>
>>
>> Sergey Beryozkin-2 wrote:
>>
>>>
>>> Starting with 2.2.4 it is also possible to configure an alias for the CXF
>>> servlet.
>>> Example :
>>>
>>>  For the most part, in the spring config, instead of importing
>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>>> you would import
>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>>
>>>> The "address" used on jaxws:endpoint and such would just be:
>>>>
>>>> /blah
>>>>
>>>> with no http://host:port type thing.
>>>>
>>>
>>> would result in http://host:8181/cxf/blah URI being support but a given
>>> jaxws or jaxrs endpoint.
>>>
>>> Port '8181' can be changed in the etc/config.properties. You can add an
>>> org.apache.cxf.osgi.cfg to /etc directory and set the
>>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>>> will be used instead of 'cxf'. This property can also be configured using
>>> shell config commands and indeed the changes can be
>>> persisted and restored after the restart  with the latest Karaf fix from
>>> Guilluame.
>>>
>>> cheers, Sergey
>>>
>>>  On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>>>>
>>>>> Hi there
>>>>>
>>>>> When a customer deploys several applications into an osgi container
>>>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine
>>>>> with
>>>>>  security configurations etc. An idea is to re-use the osgi http
>>>>> service.
>>>>>  Is this possible? Somehow, the osgi http service must know under which
>>>>>  circumstances the request should be dispatched to cxf.
>>>>>
>>>>
>>>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport
>>>> for cxf
>>>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved
>>>> that
>>>> code into cxf where we can maintain it better.
>>>>
>>>> For the most part, in the spring config, instead of importing
>>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>>> you would import
>>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>>
>>>> The "address" used on jaxws:endpoint and such would just be:
>>>>
>>>> /blah
>>>>
>>>> with no http://host:port type thing.
>>>>
>>>>
>>>> --
>>>> Daniel Kulp
>>>> dkulp@apache.org
>>>> http://www.dankulp.com/blog
>>>>
>>>
>>>
>>>
>>>
>> --
>> View this message in context:
>> http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp25965535p25998548.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>


-- 
Jaime Hablutzel

(tildes omitidas intencionalmente) 9 8964 0369

Re: Use of OSGi http service instead of jetty engine

Posted by Christian Schneider <ch...@die-schneider.net>.
Ah yes .. I think you are right. Using the context a new servlet should 
be created per context.
Not sure how well this works though. I personally did never use the 
context setting.

Christian

On 07.01.2016 10:06, Setya wrote:
> Hi Sergey,
>
> Sorry for bringing back this old thread.
>
> I'm using CXF DOSGI on Apache Karaf 4.0.3.
>
> I can change the context as you suggested to anything but '/'. Is this no
> longer supported ?
>
> Thanks & Regards,
> Setya
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp547907p5764462.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Use of OSGi http service instead of jetty engine

Posted by Setya <js...@gmail.com>.
Hi Sergey,

Sorry for bringing back this old thread.

I'm using CXF DOSGI on Apache Karaf 4.0.3.

I can change the context as you suggested to anything but '/'. Is this no
longer supported ?

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp547907p5764462.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Use of OSGi http service instead of jetty engine

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi

For changing the port please update etc/system.properties  (sorry, not etc/config.properties):

org.osgi.service.http.port=9090

'cxf' context :

>> You can add an
>> org.apache.cxf.osgi.cfg to /etc directory and set the 
>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>> will be used instead of 'cxf'.


cheers, Sergey

> 
> Hi Sergey, what exactly should be added to etc/config.properties to change
> cxf context and 8181 port??
> 
> 
> 
> 
> Sergey Beryozkin-2 wrote:
>> 
>> Starting with 2.2.4 it is also possible to configure an alias for the CXF
>> servlet.
>> Example :
>> 
>>> For the most part, in the spring config, instead of importing
>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>> you would import
>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>
>>> The "address" used on jaxws:endpoint and such would just be:
>>>
>>> /blah
>>>
>>> with no http://host:port type thing.
>> 
>> would result in http://host:8181/cxf/blah URI being support but a given
>> jaxws or jaxrs endpoint.
>> 
>> Port '8181' can be changed in the etc/config.properties. You can add an
>> org.apache.cxf.osgi.cfg to /etc directory and set the 
>> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
>> will be used instead of 'cxf'. This property can also be 
>> configured using shell config commands and indeed the changes can be
>> persisted and restored after the restart  with the latest Karaf 
>> fix from Guilluame.
>> 
>> cheers, Sergey
>> 
>>> On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>>>> Hi there
>>>>
>>>> When a customer deploys several applications into an osgi container
>>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine
>>>> with
>>>>  security configurations etc. An idea is to re-use the osgi http
>>>> service.
>>>>  Is this possible? Somehow, the osgi http service must know under which
>>>>  circumstances the request should be dispatched to cxf.
>>>
>>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport
>>> for cxf
>>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved
>>> that
>>> code into cxf where we can maintain it better.
>>>
>>> For the most part, in the spring config, instead of importing
>>> META-INF/cxf/cxf-extension-http-jetty.xml
>>> you would import
>>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>>
>>> The "address" used on jaxws:endpoint and such would just be:
>>>
>>> /blah
>>>
>>> with no http://host:port type thing.
>>>
>>>
>>> -- 
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://www.dankulp.com/blog 
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp25965535p25998548.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: Use of OSGi http service instead of jetty engine

Posted by skarootz <ha...@gmail.com>.
Hi Sergey, what exactly should be added to etc/config.properties to change
cxf context and 8181 port??




Sergey Beryozkin-2 wrote:
> 
> Starting with 2.2.4 it is also possible to configure an alias for the CXF
> servlet.
> Example :
> 
>> For the most part, in the spring config, instead of importing
>> META-INF/cxf/cxf-extension-http-jetty.xml
>> you would import
>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>
>> The "address" used on jaxws:endpoint and such would just be:
>>
>> /blah
>>
>> with no http://host:port type thing.
> 
> would result in http://host:8181/cxf/blah URI being support but a given
> jaxws or jaxrs endpoint.
> 
> Port '8181' can be changed in the etc/config.properties. You can add an
> org.apache.cxf.osgi.cfg to /etc directory and set the 
> 'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it
> will be used instead of 'cxf'. This property can also be 
> configured using shell config commands and indeed the changes can be
> persisted and restored after the restart  with the latest Karaf 
> fix from Guilluame.
> 
> cheers, Sergey
> 
>> On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>>> Hi there
>>>
>>> When a customer deploys several applications into an osgi container
>>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine
>>> with
>>>  security configurations etc. An idea is to re-use the osgi http
>>> service.
>>>  Is this possible? Somehow, the osgi http service must know under which
>>>  circumstances the request should be dispatched to cxf.
>>
>> Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport
>> for cxf
>> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved
>> that
>> code into cxf where we can maintain it better.
>>
>> For the most part, in the spring config, instead of importing
>> META-INF/cxf/cxf-extension-http-jetty.xml
>> you would import
>> META-INF/cxf/osgi/cxf-extension-osgi.xml
>>
>> The "address" used on jaxws:endpoint and such would just be:
>>
>> /blah
>>
>> with no http://host:port type thing.
>>
>>
>> -- 
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-tp25965535p25998548.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Use of OSGi http service instead of jetty engine

Posted by Sergey Beryozkin <sb...@progress.com>.
Starting with 2.2.4 it is also possible to configure an alias for the CXF servlet.
Example :

> For the most part, in the spring config, instead of importing
> META-INF/cxf/cxf-extension-http-jetty.xml
> you would import
> META-INF/cxf/osgi/cxf-extension-osgi.xml
>
> The "address" used on jaxws:endpoint and such would just be:
>
> /blah
>
> with no http://host:port type thing.

would result in http://host:8181/cxf/blah URI being support but a given jaxws or jaxrs endpoint.

Port '8181' can be changed in the etc/config.properties. You can add an org.apache.cxf.osgi.cfg to /etc directory and set the 
'org.apache.cxf.servlet.context' property to say '/' or '/custom' and it will be used instead of 'cxf'. This property can also be 
configured using shell config commands and indeed the changes can be persisted and restored after the restart  with the latest Karaf 
fix from Guilluame.

cheers, Sergey

> On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
>> Hi there
>>
>> When a customer deploys several applications into an osgi container
>>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine with
>>  security configurations etc. An idea is to re-use the osgi http service.
>>  Is this possible? Somehow, the osgi http service must know under which
>>  circumstances the request should be dispatched to cxf.
>
> Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport for cxf
> thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved that
> code into cxf where we can maintain it better.
>
> For the most part, in the spring config, instead of importing
> META-INF/cxf/cxf-extension-http-jetty.xml
> you would import
> META-INF/cxf/osgi/cxf-extension-osgi.xml
>
> The "address" used on jaxws:endpoint and such would just be:
>
> /blah
>
> with no http://host:port type thing.
>
>
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog 


Re: Use of OSGi http service instead of jetty engine

Posted by Daniel Kulp <dk...@apache.org>.
On Mon October 19 2009 4:57:30 pm Oliver Wulff wrote:
> Hi there
> 
> When a customer deploys several applications into an osgi container
>  (servicemix 4.x) each bundle configures/(instantiates) a jetty engine with
>  security configurations etc. An idea is to re-use the osgi http service.
>  Is this possible? Somehow, the osgi http service must know under which
>  circumstances the request should be dispatched to cxf.

Yes.   Wit CXF less than 2.2.4, you would need the osgi http transport for cxf 
thing that smx 4 has in their svn repo someplace.   With 2.2.4, we moved that 
code into cxf where we can maintain it better.  

For the most part, in the spring config, instead of importing 
META-INF/cxf/cxf-extension-http-jetty.xml
you would import 
META-INF/cxf/osgi/cxf-extension-osgi.xml

The "address" used on jaxws:endpoint and such would just be:

/blah

with no http://host:port type thing.


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog