You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Yuri de Wit <yd...@gmail.com> on 2011/04/14 08:55:08 UTC

bndlib dependency in maven-bundle-plugin

I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
on an older version of bndlib 1.15.0. Is there a snapshot somewhere
with the latest 1.43.0? Where are the sources for the
maven-bundle-plugin?

The main reason I am interested in this is that I am having a strange
issue where a "uses"directive is not being generated in the
Import-Package/Export-Package for a specific package and I end up
getting a NoClassDefFoundError when activating the module in felix. I
have X and Y modules that depend on A module. The A module has an
interface A that extends another interface b.B . The X interface in
module X extends A and so does the Y interface in the module X. For
some strange reason the X module has the uses=b, but the module Y
doenst.

I hacked the Manifest to include the missing package in the uses
directive and it seems to have worked. So the question is why would
maven-bundle-plugin not generate the b package in the uses directive
for the Y module?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
Created ticket for it:

https://issues.apache.org/jira/browse/FELIX-2918

thanks,
-- yuri

On Fri, Apr 15, 2011 at 3:17 AM, Yuri de Wit <yd...@gmail.com> wrote:
> Btw, originally, in addition to a missing package in the uses
> directive, the package was also missing from the Import-Package entry.
> That would explain, I guess, why I was seeing a NoClassDefFoundError.
>
> On Thu, Apr 14, 2011 at 7:08 PM, Yuri de Wit <yd...@gmail.com> wrote:
>> As a final note, this seems definitely a bug. It seems that bnd should
>> be going deeper in the dependency tree.
>>
>> For now, as a work around, I added a dummy dependency to b.AH from
>> Bundle A and I am moving ahead.
>>
>> On Thu, Apr 14, 2011 at 6:52 PM, Yuri de Wit <yd...@gmail.com> wrote:
>>> And the reason that the other two bundles I have work is because the
>>> have another direct dependency on a.AD and a.AH.
>>>
>>> So, if I have bundle A containing:
>>> - interface a.AS extends e.ES<a.AS,a.AW>{}
>>> - interface a.AW...
>>>
>>> and a bundle E containing:
>>> - interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>> - interface e.EW..
>>> - interface b.AD{}
>>> - interface b.AH{}
>>>
>>> I would expect that the bundle A manifest would contain an explicit
>>> Import-Package to package b, but that is not the case.
>>>
>>> On Thu, Apr 14, 2011 at 6:26 PM, Yuri de Wit <yd...@gmail.com> wrote:
>>>> I ran my mvn3 build with maven-bundle-plugin v2.3.4 and attached a
>>>> debugger to it. I then stopped in the aQute.lib.osgi.Analyzer line
>>>> 1684 (t.addAll(clazz.getReferred());) for class a.AS. I was expecting
>>>> to see packages a (for a.AS and the two generic parameters a.AS and
>>>> a.AW, which happens to be in the same package), e (for e.ES interface,
>>>> and the two generic parameters a.ES and e.EW, which happens to be in
>>>> the same package) and b (b.AD and b.AH). However, I didn't see the
>>>> package b.
>>>>
>>>> I am not sure if the code is supposed to analyze a.ES a bit later and
>>>> then uncover b.AD and b.AH, but I did verify that after analyze is
>>>> done I do not see package b referred.
>>>>
>>>> Here is the makeup for the a.AS class being analyzed by bnd:
>>>>
>>>> interface a.AS extends e.ES<a.AS,a.AW>{}
>>>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>>>
>>>>
>>>> On Thu, Apr 14, 2011 at 11:55 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>>>> Peter,
>>>>>
>>>>> This is picture of the dependencies here:
>>>>>
>>>>> This is a more detailed picture:
>>>>> BUNDLE A (package a):
>>>>> --------
>>>>> BundleModule {
>>>>>  bindService(a.AS).export();
>>>>>  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
>>>>>  bind(a.AS).to(a.ASImpl);
>>>>> }
>>>>>
>>>>> class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
>>>>>  ASImpl(EB, Iterable<a.AW>)
>>>>> }
>>>>>
>>>>> interface a.AS extends e.ES<a.AS,a.AW>{}
>>>>> interface a.AW extends e.EW<a.AS,a.AW>{}
>>>>>
>>>>> BUNDLE E (packages e and b):
>>>>> --------
>>>>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>>>> interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
>>>>> interface b.AH{}
>>>>>
>>>>> Considering that I have an additional bundle with the same
>>>>> dependencies (and more) and that bundle has the "b" package included
>>>>> in the Manifest, i.e. it works, could it be that the
>>>>> maven-bundle-plugin is not "seeing" b.AD through the
>>>>> generics/inheritance when building the bundle manifest and that it
>>>>> works here due to another dependency to b.AD?
>>>>>
>>>>> On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>>>>> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>>>>>>
>>>>>> I am using Peaberry/Guice to import a service from the base module and
>>>>>> the ClassDefNotFoundError is thrown when importing multiple() in
>>>>>> Peaberry's BundleModule. However, I checked the Manifest on both the
>>>>>> bundle that works and the one that doesnt and see the difference in
>>>>>> the "uses" directive exactly in the package that contains the missing
>>>>>> class def. The two bundles extend the base bundle in the exact same
>>>>>> way and the only thing special here is the 3 level deep inheritance
>>>>>> and multiple interface extension with Generics, but they would then be
>>>>>> special for both bundles: not sure why would one work and one fail.
>>>>>>
>>>>>> If I build the bundle with the missing package in the uses directive
>>>>>> from the bundle project, as opposed to the parent project, I get the
>>>>>> exact same result (I was wondering if the reactor with all the other
>>>>>> projects could be causing a problem here).
>>>>>>
>>>>>> thanks,
>>>>>>
>>>>>> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>>>>>>> If you can send the culprit to me then I will have a look.
>>>>>>>
>>>>>>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>>>>>>
>>>>>>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>>>>>>
>>>>>>> Kind regards,
>>>>>>>
>>>>>>>        Peter Kriens
>>>>>>>
>>>>>>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>>>>>>
>>>>>>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>>>>>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>>>>>>> with the latest 1.43.0? Where are the sources for the
>>>>>>>> maven-bundle-plugin?
>>>>>>>>
>>>>>>>> The main reason I am interested in this is that I am having a strange
>>>>>>>> issue where a "uses"directive is not being generated in the
>>>>>>>> Import-Package/Export-Package for a specific package and I end up
>>>>>>>> getting a NoClassDefFoundError when activating the module in felix. I
>>>>>>>> have X and Y modules that depend on A module. The A module has an
>>>>>>>> interface A that extends another interface b.B . The X interface in
>>>>>>>> module X extends A and so does the Y interface in the module X. For
>>>>>>>> some strange reason the X module has the uses=b, but the module Y
>>>>>>>> doenst.
>>>>>>>>
>>>>>>>> I hacked the Manifest to include the missing package in the uses
>>>>>>>> directive and it seems to have worked. So the question is why would
>>>>>>>> maven-bundle-plugin not generate the b package in the uses directive
>>>>>>>> for the Y module?
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
Btw, originally, in addition to a missing package in the uses
directive, the package was also missing from the Import-Package entry.
That would explain, I guess, why I was seeing a NoClassDefFoundError.

On Thu, Apr 14, 2011 at 7:08 PM, Yuri de Wit <yd...@gmail.com> wrote:
> As a final note, this seems definitely a bug. It seems that bnd should
> be going deeper in the dependency tree.
>
> For now, as a work around, I added a dummy dependency to b.AH from
> Bundle A and I am moving ahead.
>
> On Thu, Apr 14, 2011 at 6:52 PM, Yuri de Wit <yd...@gmail.com> wrote:
>> And the reason that the other two bundles I have work is because the
>> have another direct dependency on a.AD and a.AH.
>>
>> So, if I have bundle A containing:
>> - interface a.AS extends e.ES<a.AS,a.AW>{}
>> - interface a.AW...
>>
>> and a bundle E containing:
>> - interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>> - interface e.EW..
>> - interface b.AD{}
>> - interface b.AH{}
>>
>> I would expect that the bundle A manifest would contain an explicit
>> Import-Package to package b, but that is not the case.
>>
>> On Thu, Apr 14, 2011 at 6:26 PM, Yuri de Wit <yd...@gmail.com> wrote:
>>> I ran my mvn3 build with maven-bundle-plugin v2.3.4 and attached a
>>> debugger to it. I then stopped in the aQute.lib.osgi.Analyzer line
>>> 1684 (t.addAll(clazz.getReferred());) for class a.AS. I was expecting
>>> to see packages a (for a.AS and the two generic parameters a.AS and
>>> a.AW, which happens to be in the same package), e (for e.ES interface,
>>> and the two generic parameters a.ES and e.EW, which happens to be in
>>> the same package) and b (b.AD and b.AH). However, I didn't see the
>>> package b.
>>>
>>> I am not sure if the code is supposed to analyze a.ES a bit later and
>>> then uncover b.AD and b.AH, but I did verify that after analyze is
>>> done I do not see package b referred.
>>>
>>> Here is the makeup for the a.AS class being analyzed by bnd:
>>>
>>> interface a.AS extends e.ES<a.AS,a.AW>{}
>>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>>
>>>
>>> On Thu, Apr 14, 2011 at 11:55 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>>> Peter,
>>>>
>>>> This is picture of the dependencies here:
>>>>
>>>> This is a more detailed picture:
>>>> BUNDLE A (package a):
>>>> --------
>>>> BundleModule {
>>>>  bindService(a.AS).export();
>>>>  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
>>>>  bind(a.AS).to(a.ASImpl);
>>>> }
>>>>
>>>> class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
>>>>  ASImpl(EB, Iterable<a.AW>)
>>>> }
>>>>
>>>> interface a.AS extends e.ES<a.AS,a.AW>{}
>>>> interface a.AW extends e.EW<a.AS,a.AW>{}
>>>>
>>>> BUNDLE E (packages e and b):
>>>> --------
>>>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>>> interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
>>>> interface b.AH{}
>>>>
>>>> Considering that I have an additional bundle with the same
>>>> dependencies (and more) and that bundle has the "b" package included
>>>> in the Manifest, i.e. it works, could it be that the
>>>> maven-bundle-plugin is not "seeing" b.AD through the
>>>> generics/inheritance when building the bundle manifest and that it
>>>> works here due to another dependency to b.AD?
>>>>
>>>> On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>>>> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>>>>>
>>>>> I am using Peaberry/Guice to import a service from the base module and
>>>>> the ClassDefNotFoundError is thrown when importing multiple() in
>>>>> Peaberry's BundleModule. However, I checked the Manifest on both the
>>>>> bundle that works and the one that doesnt and see the difference in
>>>>> the "uses" directive exactly in the package that contains the missing
>>>>> class def. The two bundles extend the base bundle in the exact same
>>>>> way and the only thing special here is the 3 level deep inheritance
>>>>> and multiple interface extension with Generics, but they would then be
>>>>> special for both bundles: not sure why would one work and one fail.
>>>>>
>>>>> If I build the bundle with the missing package in the uses directive
>>>>> from the bundle project, as opposed to the parent project, I get the
>>>>> exact same result (I was wondering if the reactor with all the other
>>>>> projects could be causing a problem here).
>>>>>
>>>>> thanks,
>>>>>
>>>>> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>>>>>> If you can send the culprit to me then I will have a look.
>>>>>>
>>>>>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>>>>>
>>>>>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>>>>>
>>>>>> Kind regards,
>>>>>>
>>>>>>        Peter Kriens
>>>>>>
>>>>>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>>>>>
>>>>>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>>>>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>>>>>> with the latest 1.43.0? Where are the sources for the
>>>>>>> maven-bundle-plugin?
>>>>>>>
>>>>>>> The main reason I am interested in this is that I am having a strange
>>>>>>> issue where a "uses"directive is not being generated in the
>>>>>>> Import-Package/Export-Package for a specific package and I end up
>>>>>>> getting a NoClassDefFoundError when activating the module in felix. I
>>>>>>> have X and Y modules that depend on A module. The A module has an
>>>>>>> interface A that extends another interface b.B . The X interface in
>>>>>>> module X extends A and so does the Y interface in the module X. For
>>>>>>> some strange reason the X module has the uses=b, but the module Y
>>>>>>> doenst.
>>>>>>>
>>>>>>> I hacked the Manifest to include the missing package in the uses
>>>>>>> directive and it seems to have worked. So the question is why would
>>>>>>> maven-bundle-plugin not generate the b package in the uses directive
>>>>>>> for the Y module?
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
As a final note, this seems definitely a bug. It seems that bnd should
be going deeper in the dependency tree.

For now, as a work around, I added a dummy dependency to b.AH from
Bundle A and I am moving ahead.

On Thu, Apr 14, 2011 at 6:52 PM, Yuri de Wit <yd...@gmail.com> wrote:
> And the reason that the other two bundles I have work is because the
> have another direct dependency on a.AD and a.AH.
>
> So, if I have bundle A containing:
> - interface a.AS extends e.ES<a.AS,a.AW>{}
> - interface a.AW...
>
> and a bundle E containing:
> - interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
> - interface e.EW..
> - interface b.AD{}
> - interface b.AH{}
>
> I would expect that the bundle A manifest would contain an explicit
> Import-Package to package b, but that is not the case.
>
> On Thu, Apr 14, 2011 at 6:26 PM, Yuri de Wit <yd...@gmail.com> wrote:
>> I ran my mvn3 build with maven-bundle-plugin v2.3.4 and attached a
>> debugger to it. I then stopped in the aQute.lib.osgi.Analyzer line
>> 1684 (t.addAll(clazz.getReferred());) for class a.AS. I was expecting
>> to see packages a (for a.AS and the two generic parameters a.AS and
>> a.AW, which happens to be in the same package), e (for e.ES interface,
>> and the two generic parameters a.ES and e.EW, which happens to be in
>> the same package) and b (b.AD and b.AH). However, I didn't see the
>> package b.
>>
>> I am not sure if the code is supposed to analyze a.ES a bit later and
>> then uncover b.AD and b.AH, but I did verify that after analyze is
>> done I do not see package b referred.
>>
>> Here is the makeup for the a.AS class being analyzed by bnd:
>>
>> interface a.AS extends e.ES<a.AS,a.AW>{}
>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>
>>
>> On Thu, Apr 14, 2011 at 11:55 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>> Peter,
>>>
>>> This is picture of the dependencies here:
>>>
>>> This is a more detailed picture:
>>> BUNDLE A (package a):
>>> --------
>>> BundleModule {
>>>  bindService(a.AS).export();
>>>  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
>>>  bind(a.AS).to(a.ASImpl);
>>> }
>>>
>>> class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
>>>  ASImpl(EB, Iterable<a.AW>)
>>> }
>>>
>>> interface a.AS extends e.ES<a.AS,a.AW>{}
>>> interface a.AW extends e.EW<a.AS,a.AW>{}
>>>
>>> BUNDLE E (packages e and b):
>>> --------
>>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>>> interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
>>> interface b.AH{}
>>>
>>> Considering that I have an additional bundle with the same
>>> dependencies (and more) and that bundle has the "b" package included
>>> in the Manifest, i.e. it works, could it be that the
>>> maven-bundle-plugin is not "seeing" b.AD through the
>>> generics/inheritance when building the bundle manifest and that it
>>> works here due to another dependency to b.AD?
>>>
>>> On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>>> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>>>>
>>>> I am using Peaberry/Guice to import a service from the base module and
>>>> the ClassDefNotFoundError is thrown when importing multiple() in
>>>> Peaberry's BundleModule. However, I checked the Manifest on both the
>>>> bundle that works and the one that doesnt and see the difference in
>>>> the "uses" directive exactly in the package that contains the missing
>>>> class def. The two bundles extend the base bundle in the exact same
>>>> way and the only thing special here is the 3 level deep inheritance
>>>> and multiple interface extension with Generics, but they would then be
>>>> special for both bundles: not sure why would one work and one fail.
>>>>
>>>> If I build the bundle with the missing package in the uses directive
>>>> from the bundle project, as opposed to the parent project, I get the
>>>> exact same result (I was wondering if the reactor with all the other
>>>> projects could be causing a problem here).
>>>>
>>>> thanks,
>>>>
>>>> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>>>>> If you can send the culprit to me then I will have a look.
>>>>>
>>>>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>>>>
>>>>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>>>>
>>>>> Kind regards,
>>>>>
>>>>>        Peter Kriens
>>>>>
>>>>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>>>>
>>>>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>>>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>>>>> with the latest 1.43.0? Where are the sources for the
>>>>>> maven-bundle-plugin?
>>>>>>
>>>>>> The main reason I am interested in this is that I am having a strange
>>>>>> issue where a "uses"directive is not being generated in the
>>>>>> Import-Package/Export-Package for a specific package and I end up
>>>>>> getting a NoClassDefFoundError when activating the module in felix. I
>>>>>> have X and Y modules that depend on A module. The A module has an
>>>>>> interface A that extends another interface b.B . The X interface in
>>>>>> module X extends A and so does the Y interface in the module X. For
>>>>>> some strange reason the X module has the uses=b, but the module Y
>>>>>> doenst.
>>>>>>
>>>>>> I hacked the Manifest to include the missing package in the uses
>>>>>> directive and it seems to have worked. So the question is why would
>>>>>> maven-bundle-plugin not generate the b package in the uses directive
>>>>>> for the Y module?
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>>
>>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
And the reason that the other two bundles I have work is because the
have another direct dependency on a.AD and a.AH.

So, if I have bundle A containing:
- interface a.AS extends e.ES<a.AS,a.AW>{}
- interface a.AW...

and a bundle E containing:
- interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
- interface e.EW..
- interface b.AD{}
- interface b.AH{}

I would expect that the bundle A manifest would contain an explicit
Import-Package to package b, but that is not the case.

On Thu, Apr 14, 2011 at 6:26 PM, Yuri de Wit <yd...@gmail.com> wrote:
> I ran my mvn3 build with maven-bundle-plugin v2.3.4 and attached a
> debugger to it. I then stopped in the aQute.lib.osgi.Analyzer line
> 1684 (t.addAll(clazz.getReferred());) for class a.AS. I was expecting
> to see packages a (for a.AS and the two generic parameters a.AS and
> a.AW, which happens to be in the same package), e (for e.ES interface,
> and the two generic parameters a.ES and e.EW, which happens to be in
> the same package) and b (b.AD and b.AH). However, I didn't see the
> package b.
>
> I am not sure if the code is supposed to analyze a.ES a bit later and
> then uncover b.AD and b.AH, but I did verify that after analyze is
> done I do not see package b referred.
>
> Here is the makeup for the a.AS class being analyzed by bnd:
>
> interface a.AS extends e.ES<a.AS,a.AW>{}
> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>
>
> On Thu, Apr 14, 2011 at 11:55 AM, Yuri de Wit <yd...@gmail.com> wrote:
>> Peter,
>>
>> This is picture of the dependencies here:
>>
>> This is a more detailed picture:
>> BUNDLE A (package a):
>> --------
>> BundleModule {
>>  bindService(a.AS).export();
>>  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
>>  bind(a.AS).to(a.ASImpl);
>> }
>>
>> class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
>>  ASImpl(EB, Iterable<a.AW>)
>> }
>>
>> interface a.AS extends e.ES<a.AS,a.AW>{}
>> interface a.AW extends e.EW<a.AS,a.AW>{}
>>
>> BUNDLE E (packages e and b):
>> --------
>> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
>> interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
>> interface b.AH{}
>>
>> Considering that I have an additional bundle with the same
>> dependencies (and more) and that bundle has the "b" package included
>> in the Manifest, i.e. it works, could it be that the
>> maven-bundle-plugin is not "seeing" b.AD through the
>> generics/inheritance when building the bundle manifest and that it
>> works here due to another dependency to b.AD?
>>
>> On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
>>> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>>>
>>> I am using Peaberry/Guice to import a service from the base module and
>>> the ClassDefNotFoundError is thrown when importing multiple() in
>>> Peaberry's BundleModule. However, I checked the Manifest on both the
>>> bundle that works and the one that doesnt and see the difference in
>>> the "uses" directive exactly in the package that contains the missing
>>> class def. The two bundles extend the base bundle in the exact same
>>> way and the only thing special here is the 3 level deep inheritance
>>> and multiple interface extension with Generics, but they would then be
>>> special for both bundles: not sure why would one work and one fail.
>>>
>>> If I build the bundle with the missing package in the uses directive
>>> from the bundle project, as opposed to the parent project, I get the
>>> exact same result (I was wondering if the reactor with all the other
>>> projects could be causing a problem here).
>>>
>>> thanks,
>>>
>>> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>>>> If you can send the culprit to me then I will have a look.
>>>>
>>>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>>>
>>>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>>>
>>>> Kind regards,
>>>>
>>>>        Peter Kriens
>>>>
>>>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>>>
>>>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>>>> with the latest 1.43.0? Where are the sources for the
>>>>> maven-bundle-plugin?
>>>>>
>>>>> The main reason I am interested in this is that I am having a strange
>>>>> issue where a "uses"directive is not being generated in the
>>>>> Import-Package/Export-Package for a specific package and I end up
>>>>> getting a NoClassDefFoundError when activating the module in felix. I
>>>>> have X and Y modules that depend on A module. The A module has an
>>>>> interface A that extends another interface b.B . The X interface in
>>>>> module X extends A and so does the Y interface in the module X. For
>>>>> some strange reason the X module has the uses=b, but the module Y
>>>>> doenst.
>>>>>
>>>>> I hacked the Manifest to include the missing package in the uses
>>>>> directive and it seems to have worked. So the question is why would
>>>>> maven-bundle-plugin not generate the b package in the uses directive
>>>>> for the Y module?
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
I ran my mvn3 build with maven-bundle-plugin v2.3.4 and attached a
debugger to it. I then stopped in the aQute.lib.osgi.Analyzer line
1684 (t.addAll(clazz.getReferred());) for class a.AS. I was expecting
to see packages a (for a.AS and the two generic parameters a.AS and
a.AW, which happens to be in the same package), e (for e.ES interface,
and the two generic parameters a.ES and e.EW, which happens to be in
the same package) and b (b.AD and b.AH). However, I didn't see the
package b.

I am not sure if the code is supposed to analyze a.ES a bit later and
then uncover b.AD and b.AH, but I did verify that after analyze is
done I do not see package b referred.

Here is the makeup for the a.AS class being analyzed by bnd:

interface a.AS extends e.ES<a.AS,a.AW>{}
interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}


On Thu, Apr 14, 2011 at 11:55 AM, Yuri de Wit <yd...@gmail.com> wrote:
> Peter,
>
> This is picture of the dependencies here:
>
> This is a more detailed picture:
> BUNDLE A (package a):
> --------
> BundleModule {
>  bindService(a.AS).export();
>  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
>  bind(a.AS).to(a.ASImpl);
> }
>
> class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
>  ASImpl(EB, Iterable<a.AW>)
> }
>
> interface a.AS extends e.ES<a.AS,a.AW>{}
> interface a.AW extends e.EW<a.AS,a.AW>{}
>
> BUNDLE E (packages e and b):
> --------
> interface e.ES<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
> interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
> interface b.AH{}
>
> Considering that I have an additional bundle with the same
> dependencies (and more) and that bundle has the "b" package included
> in the Manifest, i.e. it works, could it be that the
> maven-bundle-plugin is not "seeing" b.AD through the
> generics/inheritance when building the bundle manifest and that it
> works here due to another dependency to b.AD?
>
> On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
>> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>>
>> I am using Peaberry/Guice to import a service from the base module and
>> the ClassDefNotFoundError is thrown when importing multiple() in
>> Peaberry's BundleModule. However, I checked the Manifest on both the
>> bundle that works and the one that doesnt and see the difference in
>> the "uses" directive exactly in the package that contains the missing
>> class def. The two bundles extend the base bundle in the exact same
>> way and the only thing special here is the 3 level deep inheritance
>> and multiple interface extension with Generics, but they would then be
>> special for both bundles: not sure why would one work and one fail.
>>
>> If I build the bundle with the missing package in the uses directive
>> from the bundle project, as opposed to the parent project, I get the
>> exact same result (I was wondering if the reactor with all the other
>> projects could be causing a problem here).
>>
>> thanks,
>>
>> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>>> If you can send the culprit to me then I will have a look.
>>>
>>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>>
>>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>>
>>> Kind regards,
>>>
>>>        Peter Kriens
>>>
>>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>>
>>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>>> with the latest 1.43.0? Where are the sources for the
>>>> maven-bundle-plugin?
>>>>
>>>> The main reason I am interested in this is that I am having a strange
>>>> issue where a "uses"directive is not being generated in the
>>>> Import-Package/Export-Package for a specific package and I end up
>>>> getting a NoClassDefFoundError when activating the module in felix. I
>>>> have X and Y modules that depend on A module. The A module has an
>>>> interface A that extends another interface b.B . The X interface in
>>>> module X extends A and so does the Y interface in the module X. For
>>>> some strange reason the X module has the uses=b, but the module Y
>>>> doenst.
>>>>
>>>> I hacked the Manifest to include the missing package in the uses
>>>> directive and it seems to have worked. So the question is why would
>>>> maven-bundle-plugin not generate the b package in the uses directive
>>>> for the Y module?
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
Peter,

This is picture of the dependencies here:

This is a more detailed picture:
BUNDLE A (package a):
--------
BundleModule {
  bindService(a.AS).export();
  bindService(a.AW).multiple(); // THIS IS WHEN THE EXCEPTION IS THROWN
  bind(a.AS).to(a.ASImpl);
}

class a.ASImpl extends e.ESImpl<a.AS,a.AW> implements a.AS {
  ASImpl(EB, Iterable<a.AW>)
}

interface a.AS extends e.ES<a.AS,a.AW>{}
interface a.AW extends e.EW<a.AS,a.AW>{}

BUNDLE E (packages e and b):
--------
interface e.EW<S extends e.ES<S,W>, W extends e.EW<S,W>> extends b.AD, b.AH{}
interface b.AD{}  // THIS IS THE NoClassDefFoundError CLASS
interface b.AH{}

Considering that I have an additional bundle with the same
dependencies (and more) and that bundle has the "b" package included
in the Manifest, i.e. it works, could it be that the
maven-bundle-plugin is not "seeing" b.AD through the
generics/inheritance when building the bundle manifest and that it
works here due to another dependency to b.AD?

On Thu, Apr 14, 2011 at 11:10 AM, Yuri de Wit <yd...@gmail.com> wrote:
> Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.
>
> I am using Peaberry/Guice to import a service from the base module and
> the ClassDefNotFoundError is thrown when importing multiple() in
> Peaberry's BundleModule. However, I checked the Manifest on both the
> bundle that works and the one that doesnt and see the difference in
> the "uses" directive exactly in the package that contains the missing
> class def. The two bundles extend the base bundle in the exact same
> way and the only thing special here is the 3 level deep inheritance
> and multiple interface extension with Generics, but they would then be
> special for both bundles: not sure why would one work and one fail.
>
> If I build the bundle with the missing package in the uses directive
> from the bundle project, as opposed to the parent project, I get the
> exact same result (I was wondering if the reactor with all the other
> projects could be causing a problem here).
>
> thanks,
>
> On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
>> If you can send the culprit to me then I will have a look.
>>
>> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>>
>> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>>
>> Kind regards,
>>
>>        Peter Kriens
>>
>> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>>
>>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>>> with the latest 1.43.0? Where are the sources for the
>>> maven-bundle-plugin?
>>>
>>> The main reason I am interested in this is that I am having a strange
>>> issue where a "uses"directive is not being generated in the
>>> Import-Package/Export-Package for a specific package and I end up
>>> getting a NoClassDefFoundError when activating the module in felix. I
>>> have X and Y modules that depend on A module. The A module has an
>>> interface A that extends another interface b.B . The X interface in
>>> module X extends A and so does the Y interface in the module X. For
>>> some strange reason the X module has the uses=b, but the module Y
>>> doenst.
>>>
>>> I hacked the Manifest to include the missing package in the uses
>>> directive and it seems to have worked. So the question is why would
>>> maven-bundle-plugin not generate the b package in the uses directive
>>> for the Y module?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Yuri de Wit <yd...@gmail.com>.
Indeed. I used the latest 2.3.5-SNAPSHOT and got the same results.

I am using Peaberry/Guice to import a service from the base module and
the ClassDefNotFoundError is thrown when importing multiple() in
Peaberry's BundleModule. However, I checked the Manifest on both the
bundle that works and the one that doesnt and see the difference in
the "uses" directive exactly in the package that contains the missing
class def. The two bundles extend the base bundle in the exact same
way and the only thing special here is the 3 level deep inheritance
and multiple interface extension with Generics, but they would then be
special for both bundles: not sure why would one work and one fail.

If I build the bundle with the missing package in the uses directive
from the bundle project, as opposed to the parent project, I get the
exact same result (I was wondering if the reactor with all the other
projects could be causing a problem here).

thanks,

On Thu, Apr 14, 2011 at 8:34 AM, Peter Kriens <pe...@aqute.biz> wrote:
> If you can send the culprit to me then I will have a look.
>
> It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.
>
> It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.
>
> Kind regards,
>
>        Peter Kriens
>
> On 14 apr 2011, at 08:55, Yuri de Wit wrote:
>
>> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
>> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
>> with the latest 1.43.0? Where are the sources for the
>> maven-bundle-plugin?
>>
>> The main reason I am interested in this is that I am having a strange
>> issue where a "uses"directive is not being generated in the
>> Import-Package/Export-Package for a specific package and I end up
>> getting a NoClassDefFoundError when activating the module in felix. I
>> have X and Y modules that depend on A module. The A module has an
>> interface A that extends another interface b.B . The X interface in
>> module X extends A and so does the Y interface in the module X. For
>> some strange reason the X module has the uses=b, but the module Y
>> doenst.
>>
>> I hacked the Manifest to include the missing package in the uses
>> directive and it seems to have worked. So the question is why would
>> maven-bundle-plugin not generate the b package in the uses directive
>> for the Y module?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Peter Kriens <pe...@aqute.biz>.
If you can send the culprit to me then I will have a look.

It sounds a bit odd, a missing uses directive should not end up in Class Def Not Found error, worst case you could get a class cast exception. Uses are only important for systems that have multiple versions of the same package.

It is not very likely that 1.43.0 is improving such a situation, no changes have been made in this area.

Kind regards,

	Peter Kriens

On 14 apr 2011, at 08:55, Yuri de Wit wrote:

> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
> with the latest 1.43.0? Where are the sources for the
> maven-bundle-plugin?
> 
> The main reason I am interested in this is that I am having a strange
> issue where a "uses"directive is not being generated in the
> Import-Package/Export-Package for a specific package and I end up
> getting a NoClassDefFoundError when activating the module in felix. I
> have X and Y modules that depend on A module. The A module has an
> interface A that extends another interface b.B . The X interface in
> module X extends A and so does the Y interface in the module X. For
> some strange reason the X module has the uses=b, but the module Y
> doenst.
> 
> I hacked the Manifest to include the missing package in the uses
> directive and it seems to have worked. So the question is why would
> maven-bundle-plugin not generate the b package in the uses directive
> for the Y module?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bndlib dependency in maven-bundle-plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 14 April 2011 07:55, Yuri de Wit <yd...@gmail.com> wrote:

> I noticed that the current 2.3.4 maven-bundle-plugin has a dependency
> on an older version of bndlib 1.15.0. Is there a snapshot somewhere
> with the latest 1.43.0?


https://repository.apache.org/content/groups/snapshots/org/apache/felix/maven-bundle-plugin/2.3.5-SNAPSHOT/


> Where are the sources for the maven-bundle-plugin?
>

https://svn.apache.org/repos/asf/felix/trunk/bundleplugin


> The main reason I am interested in this is that I am having a strange
> issue where a "uses"directive is not being generated in the
> Import-Package/Export-Package for a specific package and I end up
> getting a NoClassDefFoundError when activating the module in felix. I
> have X and Y modules that depend on A module. The A module has an
> interface A that extends another interface b.B . The X interface in
> module X extends A and so does the Y interface in the module X. For
> some strange reason the X module has the uses=b, but the module Y
> doenst.
>
> I hacked the Manifest to include the missing package in the uses
> directive and it seems to have worked. So the question is why would
> maven-bundle-plugin not generate the b package in the uses directive
> for the Y module?
>

if you can create a test project and attach it to JIRA that would be great:

   https://issues.apache.org/jira/browse/FELIX/component/12311143

but see if the snapshot above helps first, in case it's a known issue that's
already been fixed

---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

-- 
Cheers, Stuart