[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Aspects: problem weaving same class file in different bundles

Hi Rowan,

I assume the problem is that the aspect should weave the same class from different bundles. For the aspect both Widget classes are visible (because both should be woven) and the weaver does not know which one to use for type resolution. But this is just a first guess on the problem... Would you submit a bug in bugzilla for this issue?

Different aspects in different bundles with more specific supplement definitions should workaround this problem, but I really would like to investigate this problem in more detail (therefore the bug). Would be great if you could create a small test case for this to reproduce.


sorbus wrote:
I suspect I can't do what I want to, but here goes anyway....

I have two 'applications' as bundles in equinox. Each use the same
code, they only differ in configuration and Bundle-SymbolicName. By
same code I mean they have identical copies, not shared code/services
or anything. Like this:

Bundle A
Bundle-SymbolicName: Widget_1
Has class Widget

Bundle B
Bundle-SymbolicName: Widget_2
Has class Widget

I have a separate bundle for the aspects which has this in the header:
Eclipse-SupplementBundle: Widget_*

If I install all three bundles and start bundle A then all fine. If I
then start B I get errors such as:
java.lang.LinkageError: loader constraint violation.....
.....MyAspects have different Class objects for the type Widget used
in the signature

I can understand what is happening I think, the Widget object having
already been woven, can not be woven again.

Is there a way around this? Would it help (possible?) to have a more
tightly defined pointcut (currently using constructor call on Widget),
ie something which can distinguish between the two Widgets?

Would it help to have aspects for each Widget in separate bundles and
have a more specific Eclipse-SupplementBundle header?

equinox-dev mailing list