You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bjorn Almen <bj...@ericsson.com> on 2013/08/13 10:32:35 UTC
CXF with OSGi
I am trying to build a JAX-RS service running in OSGi context. I tried out
the minimal_osgi sample in samples/jax_rs/minimal_osgi. The sample build and
starts but two of the OSGi bundles get the status INSTALLED due to missing
dependencies.
osgi>
Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.2.R36x_v20110210
1 ACTIVE org.apache.felix.fileinstall_3.1.10
2 INSTALLED org.apache.cxf.bundle-jaxrs_2.7.6
3 ACTIVE javax.ws.rs.javax.ws.rs-api_2.0.0.m10
4 ACTIVE org.mortbay.jetty.server_6.1.24
5 ACTIVE org.apache.servicemix.specs.stax-api-1.0_1.9.0
6 ACTIVE org.apache.servicemix.specs.jsr311-api-1.1.1_1.9.0
7 ACTIVE org.apache.servicemix.specs.activation-api-1.1_1.9.0
8 INSTALLED minimalosgi_0.0.0
9 ACTIVE org.apache.felix.http.api_2.2.0
10 ACTIVE org.apache.felix.http.jetty_2.2.0
11 ACTIVE org.apache.felix.http.bridge_2.2.0
12 ACTIVE org.mortbay.jetty.security_6.1.24
13 ACTIVE org.eclipse.osgi.services_3.2.100.v20100503
14 ACTIVE org.apache.felix.http.whiteboard_2.2.0
15 ACTIVE org.apache.servicemix.specs.jaxb-api-2.2_1.9.0
16 ACTIVE org.apache.felix.http.bundle_2.2.0
17 ACTIVE org.mortbay.jetty.util_6.1.24
18 ACTIVE org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
19 ACTIVE org.apache.felix.http.base_2.2.0
The org.apache.cxf.bundle-jaxrs_2.7.6 has a lot of OPIONAL dependencies
missing but could be disregarded. But there are a number of non optional
missing as well:
Missing imported package com.ctc.wstx.stax_[4.2.0,5.0.0).
Missing imported package javax.persistence_0.0.0.
Missing imported package javax.persistence.criteria_0.0.0.
Missing imported package javax.persistence.metamodel_0.0.0.
Missing imported package org.apache.neethi_0.0.0.
Missing imported package org.dom4j_0.0.0.
Missing imported package org.dom4j.io_0.0.0.
Anyone that has managed to resolve those dependencies?
Are there any other samples with CXF in OSGi context that works?
BR, Björn
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF with OSGi
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
FYI, I've fixed the demo, both on the trunk and CXF 2.7.x,
Cheers, Sergey
[1]
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/jax_rs/minimal_osgi/
On 13/08/13 09:57, Sergey Beryozkin wrote:
> Hi
> On 13/08/13 11:32, Bjorn Almen wrote:
>> I am trying to build a JAX-RS service running in OSGi context. I tried
>> out
>> the minimal_osgi sample in samples/jax_rs/minimal_osgi. The sample
>> build and
>> starts but two of the OSGi bundles get the status INSTALLED due to
>> missing
>> dependencies.
>>
>> osgi>
>> Framework is launched.
>>
>> id State Bundle
>> 0 ACTIVE org.eclipse.osgi_3.6.2.R36x_v20110210
>> 1 ACTIVE org.apache.felix.fileinstall_3.1.10
>> 2 INSTALLED org.apache.cxf.bundle-jaxrs_2.7.6
>> 3 ACTIVE javax.ws.rs.javax.ws.rs-api_2.0.0.m10
>> 4 ACTIVE org.mortbay.jetty.server_6.1.24
>> 5 ACTIVE org.apache.servicemix.specs.stax-api-1.0_1.9.0
>> 6 ACTIVE org.apache.servicemix.specs.jsr311-api-1.1.1_1.9.0
>> 7 ACTIVE org.apache.servicemix.specs.activation-api-1.1_1.9.0
>> 8 INSTALLED minimalosgi_0.0.0
>> 9 ACTIVE org.apache.felix.http.api_2.2.0
>> 10 ACTIVE org.apache.felix.http.jetty_2.2.0
>> 11 ACTIVE org.apache.felix.http.bridge_2.2.0
>> 12 ACTIVE org.mortbay.jetty.security_6.1.24
>> 13 ACTIVE org.eclipse.osgi.services_3.2.100.v20100503
>> 14 ACTIVE org.apache.felix.http.whiteboard_2.2.0
>> 15 ACTIVE org.apache.servicemix.specs.jaxb-api-2.2_1.9.0
>> 16 ACTIVE org.apache.felix.http.bundle_2.2.0
>> 17 ACTIVE org.mortbay.jetty.util_6.1.24
>> 18 ACTIVE
>> org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
>> 19 ACTIVE org.apache.felix.http.base_2.2.0
>>
>> The org.apache.cxf.bundle-jaxrs_2.7.6 has a lot of OPIONAL dependencies
>> missing but could be disregarded. But there are a number of non optional
>> missing as well:
>>
>> Missing imported package com.ctc.wstx.stax_[4.2.0,5.0.0).
>> Missing imported package javax.persistence_0.0.0.
>> Missing imported package javax.persistence.criteria_0.0.0.
>> Missing imported package javax.persistence.metamodel_0.0.0.
>> Missing imported package org.apache.neethi_0.0.0.
>> Missing imported package org.dom4j_0.0.0.
>> Missing imported package org.dom4j.io_0.0.0.
>>
>> Anyone that has managed to resolve those dependencies?
>>
> Hmm... Why would javax.persistence.* become non-optional ? They are
> marked as optional in the cxf-rt-rs-extensions-search module.
>
> You may also consider installing individual modules as opposed to the
> large JAX-RS bundle, cxf-api, rt-core, rt-frontend-jaxrs, and
> rt-databinding-xml, that should do. In 3.0.0-SNAPSHOT, after all the
> refactoring work Dan did, it will likely be only new "core" module that
> is required, and that is all.
>
>> Are there any other samples with CXF in OSGi context that works?
>>
> Freeman recommended working with Karaf. I'll post you a link to our ESB
> demo offline
>
> Cheers, Sergey
>
>> BR, Björn
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: CXF with OSGi
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 13/08/13 11:32, Bjorn Almen wrote:
> I am trying to build a JAX-RS service running in OSGi context. I tried out
> the minimal_osgi sample in samples/jax_rs/minimal_osgi. The sample build and
> starts but two of the OSGi bundles get the status INSTALLED due to missing
> dependencies.
>
> osgi>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.6.2.R36x_v20110210
> 1 ACTIVE org.apache.felix.fileinstall_3.1.10
> 2 INSTALLED org.apache.cxf.bundle-jaxrs_2.7.6
> 3 ACTIVE javax.ws.rs.javax.ws.rs-api_2.0.0.m10
> 4 ACTIVE org.mortbay.jetty.server_6.1.24
> 5 ACTIVE org.apache.servicemix.specs.stax-api-1.0_1.9.0
> 6 ACTIVE org.apache.servicemix.specs.jsr311-api-1.1.1_1.9.0
> 7 ACTIVE org.apache.servicemix.specs.activation-api-1.1_1.9.0
> 8 INSTALLED minimalosgi_0.0.0
> 9 ACTIVE org.apache.felix.http.api_2.2.0
> 10 ACTIVE org.apache.felix.http.jetty_2.2.0
> 11 ACTIVE org.apache.felix.http.bridge_2.2.0
> 12 ACTIVE org.mortbay.jetty.security_6.1.24
> 13 ACTIVE org.eclipse.osgi.services_3.2.100.v20100503
> 14 ACTIVE org.apache.felix.http.whiteboard_2.2.0
> 15 ACTIVE org.apache.servicemix.specs.jaxb-api-2.2_1.9.0
> 16 ACTIVE org.apache.felix.http.bundle_2.2.0
> 17 ACTIVE org.mortbay.jetty.util_6.1.24
> 18 ACTIVE org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
> 19 ACTIVE org.apache.felix.http.base_2.2.0
>
> The org.apache.cxf.bundle-jaxrs_2.7.6 has a lot of OPIONAL dependencies
> missing but could be disregarded. But there are a number of non optional
> missing as well:
>
> Missing imported package com.ctc.wstx.stax_[4.2.0,5.0.0).
> Missing imported package javax.persistence_0.0.0.
> Missing imported package javax.persistence.criteria_0.0.0.
> Missing imported package javax.persistence.metamodel_0.0.0.
> Missing imported package org.apache.neethi_0.0.0.
> Missing imported package org.dom4j_0.0.0.
> Missing imported package org.dom4j.io_0.0.0.
>
> Anyone that has managed to resolve those dependencies?
>
Hmm... Why would javax.persistence.* become non-optional ? They are
marked as optional in the cxf-rt-rs-extensions-search module.
You may also consider installing individual modules as opposed to the
large JAX-RS bundle, cxf-api, rt-core, rt-frontend-jaxrs, and
rt-databinding-xml, that should do. In 3.0.0-SNAPSHOT, after all the
refactoring work Dan did, it will likely be only new "core" module that
is required, and that is all.
> Are there any other samples with CXF in OSGi context that works?
>
Freeman recommended working with Karaf. I'll post you a link to our ESB
demo offline
Cheers, Sergey
> BR, Björn
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: CXF with OSGi
Posted by Angelo zerr <an...@gmail.com>.
Hi Bjorn
If you are interested I have written several articles which explain step by
step how to develop an Eclipse RCP/RAP (3.x) whcih consumes JAX-RS services
with CXG DOSGi at
http://angelozerr.wordpress.com/about/eclipse_spring/eclipse_spring_dosgi/
I think the article
http://angelozerr.wordpress.com/2012/05/29/eclipse_spring_dosgi_step1/ could
be intersted you. It explains how to download the well JARs of CXF-DOSGi.
Hope it will help you.
Regards Angelo
2013/8/13 Bjorn Almen <bj...@ericsson.com>
> I am using the Eclipse OSGi container. Karaf is unfortunately not an option
> due to project constraints.
>
> BR, Björn
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253p5732256.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Re: CXF with OSGi
Posted by Bjorn Almen <bj...@ericsson.com>.
Thanks for the quick replies! I will take a look at Angelo's project and see
if that will help me.
BR Björn
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253p5732262.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF with OSGi
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 13/08/13 11:50, Bjorn Almen wrote:
> I am using the Eclipse OSGi container. Karaf is unfortunately not an option
> due to project constraints.
OK. In fact I was thinking of linking to Angelo's project but I see him
replying :-). I'll also take an action to get a minimal osgi demo
working again without the jaxrs-all bundle, though I'll deal with it later;
Thanks, Sergey
>
> BR, Björn
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253p5732256.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: CXF with OSGi
Posted by Bjorn Almen <bj...@ericsson.com>.
I am using the Eclipse OSGi container. Karaf is unfortunately not an option
due to project constraints.
BR, Björn
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253p5732256.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF with OSGi
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Which OSGi container you are using?
We recommend to use Karaf based OSGi container so that you can easily install cxf feature which include all necessary bundles there.
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋
On 2013-8-13, at 下午4:32, Bjorn Almen wrote:
> I am trying to build a JAX-RS service running in OSGi context. I tried out
> the minimal_osgi sample in samples/jax_rs/minimal_osgi. The sample build and
> starts but two of the OSGi bundles get the status INSTALLED due to missing
> dependencies.
>
> osgi>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.6.2.R36x_v20110210
> 1 ACTIVE org.apache.felix.fileinstall_3.1.10
> 2 INSTALLED org.apache.cxf.bundle-jaxrs_2.7.6
> 3 ACTIVE javax.ws.rs.javax.ws.rs-api_2.0.0.m10
> 4 ACTIVE org.mortbay.jetty.server_6.1.24
> 5 ACTIVE org.apache.servicemix.specs.stax-api-1.0_1.9.0
> 6 ACTIVE org.apache.servicemix.specs.jsr311-api-1.1.1_1.9.0
> 7 ACTIVE org.apache.servicemix.specs.activation-api-1.1_1.9.0
> 8 INSTALLED minimalosgi_0.0.0
> 9 ACTIVE org.apache.felix.http.api_2.2.0
> 10 ACTIVE org.apache.felix.http.jetty_2.2.0
> 11 ACTIVE org.apache.felix.http.bridge_2.2.0
> 12 ACTIVE org.mortbay.jetty.security_6.1.24
> 13 ACTIVE org.eclipse.osgi.services_3.2.100.v20100503
> 14 ACTIVE org.apache.felix.http.whiteboard_2.2.0
> 15 ACTIVE org.apache.servicemix.specs.jaxb-api-2.2_1.9.0
> 16 ACTIVE org.apache.felix.http.bundle_2.2.0
> 17 ACTIVE org.mortbay.jetty.util_6.1.24
> 18 ACTIVE org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
> 19 ACTIVE org.apache.felix.http.base_2.2.0
>
> The org.apache.cxf.bundle-jaxrs_2.7.6 has a lot of OPIONAL dependencies
> missing but could be disregarded. But there are a number of non optional
> missing as well:
>
> Missing imported package com.ctc.wstx.stax_[4.2.0,5.0.0).
> Missing imported package javax.persistence_0.0.0.
> Missing imported package javax.persistence.criteria_0.0.0.
> Missing imported package javax.persistence.metamodel_0.0.0.
> Missing imported package org.apache.neethi_0.0.0.
> Missing imported package org.dom4j_0.0.0.
> Missing imported package org.dom4j.io_0.0.0.
>
> Anyone that has managed to resolve those dependencies?
>
> Are there any other samples with CXF in OSGi context that works?
>
> BR, Björn
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-with-OSGi-tp5732253.html
> Sent from the cxf-user mailing list archive at Nabble.com.