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 <[email protected]> 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 <[email protected]> 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: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]