You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Muller, Anthony" <an...@sap.com> on 2011/06/17 15:30:24 UTC

CXF JAXRS OSGI

Hello,

I put CXF 2.3.3 in an osgi bundle and I'm trying to use it from other "webapp" bundles.

I'm using JAXRS to expose a REST webservice. It is configured thanks to CXFNonSpringJaxrsServlet. I define "jaxrs.serviceClasses" servlet param in the web.xml.

My problem: at startup, CXF tries to load the service class and it failed (due to classloader isolation).

How can I proceed to fix that? Is DOSGI the only alternative if I wish to share CXF between several "webapp" bundles?

Cheers,
Anthony

Re: CXF JAXRS OSGI

Posted by Sergey Beryozkin <sb...@gmail.com>.
np, there's a bit of confusion.

In this thread a user asked why JAX-RS service classes were not
visible (were not possible to load) inside a webapp bundle context.
Nothing to do with DOSGi.
In you similarly named thread you asked why JAX-RS annotated resources
were not recognized (as opposed to the case where an external user
model was used). I believe such issues are always caused by missing
imports and suggested to check the way DOSGi greeter_rest demo does
it, because it also has interface and impl bundles...Have a look at
that demo and see if you can make your own application work

Cheers, Sergey

On Thu, Jun 23, 2011 at 8:20 AM, mah <ms...@3dfacto.com> wrote:
>
> Sergey Beryozkin-5 wrote:
>>
>> Can you please reply in the relevant thread :-) There should be
>> another one related to CXF JAX-RS in DOSGi...
>>
>
> No, it is precisely the one =)
> Initial problem is that JAX-RS annotations were not processed. Yesterday you
> wrote, about 'webapp' bundle deployment and that it worked fine. Therefore I
> was confused, whereas I am correctly launching Felix with CXF DOSGi.
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-tp4495048p4516571.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: CXF JAXRS OSGI

Posted by mah <ms...@3dfacto.com>.
Sergey Beryozkin-5 wrote:
> 
> Can you please reply in the relevant thread :-) There should be
> another one related to CXF JAX-RS in DOSGi...
> 

No, it is precisely the one =)
Initial problem is that JAX-RS annotations were not processed. Yesterday you
wrote, about 'webapp' bundle deployment and that it worked fine. Therefore I
was confused, whereas I am correctly launching Felix with CXF DOSGi.


--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-tp4495048p4516571.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JAXRS OSGI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Can you please reply in the relevant thread :-) There should be
another one related to CXF JAX-RS in DOSGi...

thanks, Sergey

On Wed, Jun 22, 2011 at 9:58 PM, mah <ms...@3dfacto.com> wrote:
>
> Sergey Beryozkin-5 wrote:
>>
>> Did you get this issue resolved ?
>>
>
> No, not yet.
>
>
> Sergey Beryozkin-5 wrote:
>>
>> I actually did a 'webapp' bundle deployment a few days ago, and it
>> worked fine in the end, the webapp bundle had only web.xml & beans.xml
>> (which you don't need for non-Spring case), CXF bundle and application
>> service bundle were loaded before...
>>
>
> I am a bit confused here. The way I do deployment is directly through
> felix.jar. That is, I launch Felix with cxf dosgi bundles:
>>> java -jar bin\felix.jar
>
> And load interface and implementation packages (or just specify in
> felix.auto.start):
>>> start file:cxf-dosgi-ri-samples-greeter-rest-interface-1.3-SNAPSHOT.jar
>>> start file:cxf-dosgi-ri-samples-greeter-rest-impl-1.3-SNAPSHOT.jar
>
> Is that incorrect?
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-tp4495048p4515462.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Re: CXF JAXRS OSGI

Posted by mah <ms...@3dfacto.com>.
Sergey Beryozkin-5 wrote:
> 
> Did you get this issue resolved ?
> 

No, not yet.


Sergey Beryozkin-5 wrote:
> 
> I actually did a 'webapp' bundle deployment a few days ago, and it
> worked fine in the end, the webapp bundle had only web.xml & beans.xml
> (which you don't need for non-Spring case), CXF bundle and application
> service bundle were loaded before...
> 

I am a bit confused here. The way I do deployment is directly through
felix.jar. That is, I launch Felix with cxf dosgi bundles:
>> java -jar bin\felix.jar

And load interface and implementation packages (or just specify in
felix.auto.start):
>> start file:cxf-dosgi-ri-samples-greeter-rest-interface-1.3-SNAPSHOT.jar
>> start file:cxf-dosgi-ri-samples-greeter-rest-impl-1.3-SNAPSHOT.jar

Is that incorrect?

--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-tp4495048p4515462.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JAXRS OSGI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Did you get this issue resolved ?

I actually did a 'webapp' bundle deployment a few days ago, and it
worked fine in the end, the webapp bundle had only web.xml & beans.xml
(which you don't need for non-Spring case), CXF bundle and application
service bundle were loaded before...I used Require-Bundle instruction
to effectively import application service bundle a more preferred
Import-Package should do well too

Cheers, Sergey



On Fri, Jun 17, 2011 at 6:02 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi
>
> On Fri, Jun 17, 2011 at 2:30 PM, Muller, Anthony <an...@sap.com> wrote:
>> Hello,
>>
>> I put CXF 2.3.3 in an osgi bundle and I'm trying to use it from other "webapp" bundles.
>>
>> I'm using JAXRS to expose a REST webservice. It is configured thanks to CXFNonSpringJaxrsServlet. I define "jaxrs.serviceClasses" servlet param in the web.xml.
>>
>> My problem: at startup, CXF tries to load the service class and it failed (due to classloader isolation).
>>
>> How can I proceed to fix that? Is DOSGI the only alternative if I wish to share CXF between several "webapp" bundles?
>>
> Does your webabb bundle have Import-Package with a service class package ?
>
>
> Cheers, Sergey
>
>> Cheers,
>> Anthony
>>
>

Re: CXF JAXRS OSGI

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

On Fri, Jun 17, 2011 at 2:30 PM, Muller, Anthony <an...@sap.com> wrote:
> Hello,
>
> I put CXF 2.3.3 in an osgi bundle and I'm trying to use it from other "webapp" bundles.
>
> I'm using JAXRS to expose a REST webservice. It is configured thanks to CXFNonSpringJaxrsServlet. I define "jaxrs.serviceClasses" servlet param in the web.xml.
>
> My problem: at startup, CXF tries to load the service class and it failed (due to classloader isolation).
>
> How can I proceed to fix that? Is DOSGI the only alternative if I wish to share CXF between several "webapp" bundles?
>
Does your webabb bundle have Import-Package with a service class package ?


Cheers, Sergey

> Cheers,
> Anthony
>