Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] "not reweavable" errors on annotations and enums in 1.6.7 LTW

Thanks for investigating.  I'm not aware of anything I deliberately
did to change behaviours like this:

> With 1.6.7(a), using WeavingAdaptor directly in this way :
> - I have the AbortException on those types
> - aop.xml is ignored

So it might be worth raising a bug to get to the bottom of why there
is a behaviour change from 1.6.6 - then I can create some tests around
the behaviour if it is something we want to define as 'the right way'
going forward.  I did wonder if the second problem (apparently
ignoring aop.xml) is what is giving rise to the first problem
(AbortException on some types)?

Regardless, a number of users on the list seem to be trying to
interact with the weaver in this kind of way, so best practice should
be written down somewhere.

> If you give me a couple of hints, I'll try to write a wiki page.

you seem a bit more advanced than me on this stuff :)  I didn't write
that area of LTW and only recently have started getting into it as I'm
optimizing it.  I guess a wiki page initially is the best way to
collaborate and anyone else on the list who wants to chip-in can help
out.  Code from the page can become testcases/samples.

cheers,
Andy

2010/1/7 Simone Gianni <simoneg@xxxxxxxxxx>:
> Hi Andy,
> I spent some hours trying to trace this issue to create a test case. What
> I've understood up to now is that the problem resides in using a specific
> classloader for LTW, and using WeavingAdaptor instead of
> ClassLoaderWeavingAdaptor .
>
> Since this issue is quite specific to a special case (when you want to
> control LTW in a specific classloader), and since there is a workaround, I
> don't think it is a blocker for 1.6.7(a).
>
> However, just to see if it could be cause of other problems elsewhere, in
> 1.6.6 I could use LTW on a specific classloader with :
>
> public MyAdaptor implements ClassLoader, WeavingClassLoader {
>   WeavingAdaptor adaptor;
>   .....
>   this.adaptor = new WeavingAdaptor(this);
>
> Then delegate to the adaptor the weaving phase, and receive from it
> generated closure classes.
>
> With 1.6.7(a), using WeavingAdaptor directly in this way :
> - I have the AbortException on those types
> - aop.xml is ignored
>
> So, it seems like some stuff is not initialized properly (for example,
> definitions from aop.xml are never loaded).
>
> If instead I use ClassLoaderWeavingAdaptor, it works correctly, but I loose
> control on generated closures, because ClassLoaderWeavingAdaptor does not
> use the WeavingClassLoader callback for generated classes but defines them
> directly instead. I managed to get back control on them subclassing
> ClassLoaderWeavingAdaptor, but it's quite a hack.
>
> Maybe it's time to write a wiki page or update javadocs or something about
> how to use WeavingAdaptor/WeavingClassLoader/ClassLoaderWeavingAdaptor . I
> need custom control on the LTW process to chain it with other
> transformations, like JPA/coverage etc...
>
> If you give me a couple of hints, I'll try to write a wiki page.
>
> Simone
>
> Andy Clement wrote:
>>
>> a testcase would be great.
>>
>> Andy
>>
>> 2010/1/5 Simone Gianni <simoneg@xxxxxxxxxx>:
>>
>>>
>>> Hi all,
>>> I'm getting several AbortExceptions during 1.6.7 LTW about enums and
>>> annotations being "already woven and has not been built in reweavable
>>> mode".
>>>
>>> This was not happening in 1.6.6. I suppose this is a consequence of
>>> speeding
>>> up the process, cause annotations cannot be weaved at all, and
>>> enumerations
>>> have a number of limitations. In Magma we do ignore these
>>> AbortExceptions,
>>> and since we don't weave anything on enums we can safely do so returning
>>> the
>>> original type, but it still seem like something is wrong.
>>>
>>> I'll fill an entry on bigzilla (and try to setup a small test case)
>>> unless
>>> someone points out that I'm clearly missing something.
>>>
>>> Simone
>>>
>>> --
>>> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
>>> http://www.simonegianni.it/
>>>
>>> _______________________________________________
>>> aspectj-dev mailing list
>>> aspectj-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>>>
>>>
>>
>> _______________________________________________
>> aspectj-dev mailing list
>> aspectj-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>>
>
>
> --
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> http://www.simonegianni.it/
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top