Re: [aspectwerkz-dev] important patch for AnnotationCTask

the_mindstorm <[email protected]> Wed, 03 Nov 2004 18:20:42 +0200
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
Quote [Alexandre Vasseur]:
> nope
> I could reproduce it in the AW build.xml 
> 
> this occurs when the task path does not contains the annotation
> it can throw some class cast exception or some class not found.

This was the 2nd possibility ;-).

> 
> the CL is always the Thread context CL in that case, but I d rather
> use a framework class - which I find more safe.
> We do so already for the AW C somewhere
> (searhc for "new URLClassLoader(" in the source I think)

Yes indeed this is done in AspectWerkzC, but there the mechanism I have put in place was to pass 
around the classloader ;-).

:the_mindstorm

> 
> Alex
> 
> 
> On Wed, 03 Nov 2004 17:26:37 +0200, the_mindstorm
> <[email protected]> wrote:
>> Quote [Alexandre Vasseur]:
>> 
>> > Thanks
>> 
>> myp
>> 
>> >
>> > Indeed it seems to have some weird effect when we define a task with
>> > Ant and when this ones executes.
>> >
>> > I could fix the issue by removing a ClassLoader.getSystemClassLoader()
>> > and using a someAWClass.class.getClassLoader()  instead.
>> >
>> 
>> I suggest that a better solution is that we have used in AspectWerkzC - AspectWerkzCTask, and I mean
>> to pass around the ClassLoader.
>> 
>> > I still don't get why we don't see the issue in AW build.xml.
>> 
>> As I commented yesterday, I think that the log annotation isn't used in fact and this is why the
>> build works. I will dig into it and come back.
>> 
>> :the_mindstorm
>> 
>> 
>> 
>> >
>> > Alex
>> >
>> >
>> > On Tue, 02 Nov 2004 16:38:07 +0200, the_mindstorm
>> > <[email protected]> wrote:
>> >> The test:
>> >>
>> >> Attached is the test failing.
>> >> Custom annotation: net.noco.unit.aw.ContextAnnotationProxy
>> >> Class under test: net.noco.unit.SimpleTestImpl
>> >>
>> >> Before running pls follow the indications in README.
>> >>
>> >> To test run:
>> >>
>> >> [old mode => passing]
>> >> ant aw:annotation:direct run:test
>> >>
>> >> [task mode => failing with ClassCastException]
>> >> ant aw:annotation:task run:test
>> >>
>> >> After applying the patch both will run.
>> >>
>> >> I wait with interest your opinions.
>> >>
>> >> :the_mindstorm
>> >>
>> >>
>> >>
>> >
>> 
>>
>