You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Ioannis Canellos <io...@gmail.com> on 2011/11/21 12:07:27 UTC

Fragments in Karaf 3.x and OSGi 4.3

Hi all,

I encounter a strange case that I wanted to share with you, in case I miss
something.
In short lines, I am seeing that packages exported by fragment bundles not
been properly imported.

Here is an example:
I have bundle A.
I have fragment bundle B (with fragment host A), which exports package *
yet.another.package*.
Bundle C imports yet.another.package is installed and started in my karaf
3.x.

i) package:imports on bundle C *properly* displays yet.another.package as
imported package
ii) bundle:headers C displays package *yet.another.package* as *missing*.

Now if I add Bundle D that is a fragment bundle for C that also imports *
yet.another.package*, this bundle will not get attached to bundle C.
Nothing appears to the log (info & debug).

So this looks like, fragments don't properly resolve when they import
bundles from other fragments, or when their host imports packages from
other fragments.

I have tested it only on felix, since equinox currently doesn't work for me
at all.
Anyone else had a similar experience? Do you think this is a felix issue?
Any thoughts at all?

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*

Re: Fragments in Karaf 3.x and OSGi 4.3

Posted by Ioannis Canellos <io...@gmail.com>.
> Did you try to do a refresh on the host bundle (C) ? This is needed in
> order to have fragments be resolved.


Hi Guillaume,

actually the features:install does that for me, as expected. Even if I do
it manually, It still makes no difference.

I have some more findings, that simply things:

Even if bundle D does not require package *yet.another.package* it will
still not get attached. So my problem could be expressed the following way:

A bundle that imports packages exported by fragments, is not be able to
have *ANY* fragment attached to it.

If you just try to install jclouds feature, you can see that blobstore core
bundle can't get attached to jclouds-core.

Thanks.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*

Re: Fragments in Karaf 3.x and OSGi 4.3

Posted by Guillaume Nodet <gn...@gmail.com>.
Did you try to do a refresh on the host bundle (C) ? This is needed in
order to have fragments be resolved.

On Mon, Nov 21, 2011 at 12:07, Ioannis Canellos <io...@gmail.com> wrote:

> Hi all,
>
> I encounter a strange case that I wanted to share with you, in case I miss
> something.
> In short lines, I am seeing that packages exported by fragment bundles not
> been properly imported.
>
> Here is an example:
> I have bundle A.
> I have fragment bundle B (with fragment host A), which exports package *
> yet.another.package*.
> Bundle C imports yet.another.package is installed and started in my karaf
> 3.x.
>
> i) package:imports on bundle C *properly* displays yet.another.package as
> imported package
> ii) bundle:headers C displays package *yet.another.package* as *missing*.
>
> Now if I add Bundle D that is a fragment bundle for C that also imports *
> yet.another.package*, this bundle will not get attached to bundle C.
> Nothing appears to the log (info & debug).
>
> So this looks like, fragments don't properly resolve when they import
> bundles from other fragments, or when their host imports packages from
> other fragments.
>
> I have tested it only on felix, since equinox currently doesn't work for me
> at all.
> Anyone else had a similar experience? Do you think this is a felix issue?
> Any thoughts at all?
>
> --
> *Ioannis Canellos*
> *
> FuseSource <http://fusesource.com>
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache Camel <http://camel.apache.org/> Committer
> Apache ServiceMix <http://servicemix.apache.org/>  Committer
> Apache Gora <http://incubator.apache.org/gora/> Committer
> Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
> *
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Fragments in Karaf 3.x and OSGi 4.3

Posted by mikevan <mv...@comcast.net>.
Ioannis,

I will definately do this this weekend.  Are you targeting jclouds-karaf as
a potential new subproject?  If so, is there any way that I can help?  My
work on a vclouds module for cellar has halted, as this capability doesn't
make sense in my karaf implementation. That said, I absolutely see the
utility of getting Karaf more cloud functionality.


iocanel wrote
> 
> Hi Mike,
> 
> If you want to play around this issue you can try to install jclouds-karaf
> inside karaf 3.x.
> 
> You can find the project in my github repository.
> 
> For this example:
> Bundle A is guice.
> Bundle B is assisted-inject
> Bundle C is jclouds-core
> Bundle D are fragments of jclouds-core.
> 
> You can easily reporduce if after adding the repo, you install the feature
> jclouds-aws-ec2.
> 
> -- 
> *Ioannis Canellos*
> *
> FuseSource &lt;http://fusesource.com&gt;
> 
> **
> Blog: http://iocanel.blogspot.com
> **
> Apache Karaf &lt;http://karaf.apache.org/&gt; Committer & PMC
> Apache Camel &lt;http://camel.apache.org/&gt; Committer
> Apache ServiceMix &lt;http://servicemix.apache.org/&gt;  Committer
> Apache Gora &lt;http://incubator.apache.org/gora/&gt; Committer
> Apache DirectMemory &lt;http://incubator.apache.org/directmemory/&gt;
> Committer
> *
> 


-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/Fragments-in-Karaf-3-x-and-OSGi-4-3-tp3524449p3529182.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Fragments in Karaf 3.x and OSGi 4.3

Posted by Ioannis Canellos <io...@gmail.com>.
Hi Mike,

If you want to play around this issue you can try to install jclouds-karaf
inside karaf 3.x.

You can find the project in my github repository.

For this example:
Bundle A is guice.
Bundle B is assisted-inject
Bundle C is jclouds-core
Bundle D are fragments of jclouds-core.

You can easily reporduce if after adding the repo, you install the feature
jclouds-aws-ec2.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*

Re: Fragments in Karaf 3.x and OSGi 4.3

Posted by mikevan <mv...@comcast.net>.
Ioannis,

This is something I'd like to see a use-case for with code. That will help
us determine what the specific issue is. Can you code something up quickly
and drop it into a new github project?  I'll have some time this weekend to
download it and tinker work through the problem.  To ensure we reduce the
number of tangental technologies that are causing this, I would suggest the
example use Aries and Java only.

Also, from your explanation, this looks like this could be a Felix issue. Do
you think cross-posting this would be a good idea?


iocanel wrote
> 
> Hi all,
> 
> I encounter a strange case that I wanted to share with you, in case I miss
> something.
> In short lines, I am seeing that packages exported by fragment bundles not
> been properly imported.
> 
> Here is an example:
> I have bundle A.
> I have fragment bundle B (with fragment host A), which exports package *
> yet.another.package*.
> Bundle C imports yet.another.package is installed and started in my karaf
> 3.x.
> 
> i) package:imports on bundle C *properly* displays yet.another.package as
> imported package
> ii) bundle:headers C displays package *yet.another.package* as *missing*.
> 
> Now if I add Bundle D that is a fragment bundle for C that also imports *
> yet.another.package*, this bundle will not get attached to bundle C.
> Nothing appears to the log (info & debug).
> 
> So this looks like, fragments don't properly resolve when they import
> bundles from other fragments, or when their host imports packages from
> other fragments.
> 
> I have tested it only on felix, since equinox currently doesn't work for
> me
> at all.
> Anyone else had a similar experience? Do you think this is a felix issue?
> Any thoughts at all?
> 
> -- 
> *Ioannis Canellos*
> *
> FuseSource &lt;http://fusesource.com&gt;
> 
> **
> Blog: http://iocanel.blogspot.com
> **
> Apache Karaf &lt;http://karaf.apache.org/&gt; Committer & PMC
> Apache Camel &lt;http://camel.apache.org/&gt; Committer
> Apache ServiceMix &lt;http://servicemix.apache.org/&gt;  Committer
> Apache Gora &lt;http://incubator.apache.org/gora/&gt; Committer
> Apache DirectMemory &lt;http://incubator.apache.org/directmemory/&gt;
> Committer
> *
> 


-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/Fragments-in-Karaf-3-x-and-OSGi-4-3-tp3524449p3528728.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.