You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Emmanuel Ligne <el...@yahoo.fr> on 2011/03/08 14:26:41 UTC

[DOSGi] singlebundle jar exposing dependencies

Hi everyone,

Just developed a small OSGi bundle, and made it remotely available as a
WebService using iPojo and
dosgi singlebundle 1.2.
Everything works fine when the runtime platform (felix) is populated
manually with osgi-compendium and dosgi singlebundle (cf dosgi samples).
I try to automate the building of a minimal runtime platform by
automatically following the dependencies of
my top-levels osgi bundles. I'm using maven-dependency-bundle for that, goal
. 

Running this on a pom depending on dosgi singlebundle imports all the
bundles already packaged inside 
dosgi singlebundle. This ultimately breaks the runtime, which does not start
correctly.

Is there a way to repackage dosgi singlebundle so that it does not import
dependencies on the packages it already include ? Just tried with 1.3
snapshot and still the same issue.

Thanks 
Emmanuel

--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-singlebundle-jar-exposing-dependencies-tp3413919p3413919.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: [DOSGi] singlebundle jar exposing dependencies

Posted by Pierre-Henry Perret <ph...@gmail.com>.
Emmanuel Ligne wrote:
> 
> Hi David
> 
> Thx for the reply.
> The multi-bundle distro as described needs a manual fixing of the
> conf.properties of the Felix distro, what
> I cannot do in my environment: my env is automatically built by maven,
> based on dependencies. Even felix is installed as a runtime dependency.
> 

This is a typical 'single class loader' build which delegates dependencies
responsibility to a top level pom, which , in the case of an OSGi applicatin
, has to be reevaluated, reflecting the fact that a bundle can shared/reused
by others components.




> My problem is that I cannot modify the felix configuration file, as felix
> is seen as a simple "dependency" and installed as a jar by maven
> 

You should depend on API only, not a specific implementation.


>  -> the manual fixing of the conf.properties of the felix is not
> acceptable.
> 
ok



> -> so I started to try the singlebundle, but no lock with it due to the
> fact that it says it depends on the things it already integrates.
> 
Yes. It appears that your application has a foundation set of bundles which,
once loaded, could be shared/used by oothers.



> Is there a way to generate a singlebundle-like version of DOSGI that would
> not say so ? OTW my comprehension is that this *should* be packaged this
> way, as the singlebundle obvious does *not* depend on the jars it already
> includes. Right ?
> 

I dont think so. OSGi framework is , by essence modular, not
singlebundled...

OTH
Pierre

-----
--
Pierre
--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-singlebundle-jar-exposing-dependencies-tp3413919p3416222.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: [DOSGi] singlebundle jar exposing dependencies

Posted by David Bosschaert <da...@gmail.com>.
Hi Emmanuel,

It's the order of dependencies and the specification of the start
level that's the issue, right? It should not really be needed to start
bundles in a certain order, but there a number of dependencies of
DOSGi that need to be started in a specific order to work properly.
This is caused by the fact that these libraries are not developed with
OSGi in mind and make certain assumptions about their environment :(

You can also control the start level from another bundle, through the
StartLevel service [1], so you could write a little bundle that sets
the start level for the applicable bundle correctly before starting
them up which would alleviate the need to change anything in a config
file...

On the other hand you might find it easier to us a modified version of
the single-bundle distro. I don't fully remember all the details of
why it's configured the way it is, but if you want you can either
create an alternative single-bundle distro by for your own use based
on the pom.xml that is used by DOSGi [2] or you might want to provide
a patch to DOSGi that works for you and I am then happy to look at if
we can take that into the DOSGi code base... See also the build pages
for more info [3].

Cheers,

David

[1] http://www.osgi.org/javadoc/r4v42/org/osgi/service/startlevel/StartLevel.html
[2] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/single-bundle/pom.xml
[3] http://cxf.apache.org/dosgi-build.html

On 9 March 2011 16:02, Emmanuel Ligne <el...@yahoo.fr> wrote:
> Hi David
>
> Thx for the reply.
> The multi-bundle distro as described needs a manual fixing of the
> conf.properties of the Felix distro, what
> I cannot do in my environment: my env is automatically built by maven, based
> on dependencies. Even felix is installed as a runtime dependency. If I
> include solely dependencies to cxf-bundle-minimal,
> cxf-dosgi-ri-discovery-local and cxf-dosgi-ri-dsw-cxf as suggested, the
> intent-map is not read and services not published as WebServices.
> I tried to add a dependency to cxf-dosgi-felix-ri-profiles, this changed
> things, now spring complains that it cannot find the namespacehandler for
> cxf.apache.org/policy -> seems like something is not safe in the loading
> order of jars ?
> My problem is that I cannot modify the felix configuration file, as felix is
> seen as a simple "dependency" and installed as a jar by maven -> the manual
> fixing of the conf.properties of the felix is not acceptable.
> -> so I started to try the singlebundle, but no lock with it due to the fact
> that it says it depends on the things it already integrates.
> Is there a way to generate a singlebundle-like version of DOSGI that would
> not say so ? OTW my comprehension is that this *should* be packaged this
> way, as the singlebundle obvious does *not* depend on the jars it already
> includes. Right ?
>
> Best regards
> Emmanuel
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-singlebundle-jar-exposing-dependencies-tp3413919p3415816.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: [DOSGi] singlebundle jar exposing dependencies

Posted by Emmanuel Ligne <el...@yahoo.fr>.
Hi David

Thx for the reply.
The multi-bundle distro as described needs a manual fixing of the
conf.properties of the Felix distro, what
I cannot do in my environment: my env is automatically built by maven, based
on dependencies. Even felix is installed as a runtime dependency. If I
include solely dependencies to cxf-bundle-minimal,
cxf-dosgi-ri-discovery-local and cxf-dosgi-ri-dsw-cxf as suggested, the
intent-map is not read and services not published as WebServices. 
I tried to add a dependency to cxf-dosgi-felix-ri-profiles, this changed
things, now spring complains that it cannot find the namespacehandler for
cxf.apache.org/policy -> seems like something is not safe in the loading
order of jars ?
My problem is that I cannot modify the felix configuration file, as felix is
seen as a simple "dependency" and installed as a jar by maven -> the manual
fixing of the conf.properties of the felix is not acceptable.
-> so I started to try the singlebundle, but no lock with it due to the fact
that it says it depends on the things it already integrates.
Is there a way to generate a singlebundle-like version of DOSGI that would
not say so ? OTW my comprehension is that this *should* be packaged this
way, as the singlebundle obvious does *not* depend on the jars it already
includes. Right ?

Best regards
Emmanuel

--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-singlebundle-jar-exposing-dependencies-tp3413919p3415816.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: [DOSGi] singlebundle jar exposing dependencies

Posted by David Bosschaert <da...@gmail.com>.
Hi Emmanuel,

You may want to look at the multi-bundle distro
http://cxf.apache.org/dosgi-multi-bundle-setup.html
The single-bundle distro was really created to get started quickly but
it's not quite the right solution for real deployment in many cases.
One of the issue is that you might have overlap of bundles that are
both inside the single-bundle distro as well as in the OSGi framework,
which I think is your problem.

Using the multi-bundle distro should be much cleaner in that case and
although you get more bundles installed in your framework, its a much
better solution IMHO than tweaking the single-bundle distro...

Cheers,

David

On 8 March 2011 13:26, Emmanuel Ligne <el...@yahoo.fr> wrote:
> Hi everyone,
>
> Just developed a small OSGi bundle, and made it remotely available as a
> WebService using iPojo and
> dosgi singlebundle 1.2.
> Everything works fine when the runtime platform (felix) is populated
> manually with osgi-compendium and dosgi singlebundle (cf dosgi samples).
> I try to automate the building of a minimal runtime platform by
> automatically following the dependencies of
> my top-levels osgi bundles. I'm using maven-dependency-bundle for that, goal
> .
>
> Running this on a pom depending on dosgi singlebundle imports all the
> bundles already packaged inside
> dosgi singlebundle. This ultimately breaks the runtime, which does not start
> correctly.
>
> Is there a way to repackage dosgi singlebundle so that it does not import
> dependencies on the packages it already include ? Just tried with 1.3
> snapshot and still the same issue.
>
> Thanks
> Emmanuel
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-singlebundle-jar-exposing-dependencies-tp3413919p3413919.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>