Re: [aspectwerkz-user] Eclipse integration using annotations

Vinicius Carvalho <[email protected]> Wed, 20 Jul 2005 08:12:12 -0300
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Sorry for the flood, but here goes my ecllipse log:
!ENTRY AspectWerkz 1 0 2005-07-20 08:10:25.618
!MESSAGE TODO Rebuilding project - aspects have changed..

!ENTRY AspectWerkz 1 0 2005-07-20 08:10:25.618
!MESSAGE weaving HelloAspect.class

!ENTRY AspectWerkz 1 0 2005-07-20 08:10:25.678
!MESSAGE notified for com.cs.aspects.HelloAspect, 0 jp(s)

!ENTRY AspectWerkz 1 0 2005-07-20 08:10:32.217
!MESSAGE annotate HelloAspect.class

!ENTRY AspectWerkz 1 0 2005-07-20 08:10:32.217
!MESSAGE Detected a change in aspect com.cs.aspects.HelloAspect

!ENTRY AspectWerkz 4 0 2005-07-20 08:10:32.227
!MESSAGE Unexpected Exception
!STACK 0
com.thoughtworks.qdox.parser.ParseException
	at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:464)
	at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:570)
	at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:448)
	at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:296)
	at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312)
	at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:308)
	at org.codehaus.aspectwerkz.annotation.AnnotationManager.addSource(AnnotationManager.java:85)
	at org.codehaus.aspectwerkz.annotation.AnnotationC.compile(AnnotationC.java:208)
	at org.codehaus.aspectwerkz.ide.eclipse.core.project.AwAnnotationBuilder$AwAnnotationBuilderVisitor.annotate(AwAnnotationBuilder.java:300)
	at org.codehaus.aspectwerkz.ide.eclipse.core.project.AwAnnotationBuilder$AwAnnotationBuilderVisitor.visit(AwAnnotationBuilder.java:203)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
	at org.codehaus.aspectwerkz.ide.eclipse.core.project.AwAnnotationBuilder.incrementalAnnotationC(AwAnnotationBuilder.java:105)
	at org.codehaus.aspectwerkz.ide.eclipse.core.project.AwAnnotationBuilder.build(AwAnnotationBuilder.java:71)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


On 7/20/05, Vinicius Carvalho <[email protected]> wrote:
> oh, another thing, the progress bar now keeps warning: Invoking
> AspectWerkz Annotation compiler on /AspectWerkz on every 5 or 10
> seconds, and never get more than 19% done
> 
> On 7/20/05, Vinicius Carvalho <[email protected]> wrote:
> > Ok I found the error, my xmlfile had the system id with a different
> > name from the project. Now the eclipse shows a message about compiling
> > my aspects, but the pointcut does no match the desired method...
> > Also trying to run the application example using the AspectWerkz run
> > configuration, I get this error:
> > Plugin org.codehaus.aspectwerkz.ide.eclipse.core was unable to load
> > class org.codehaus.aspectwerkz.ide.eclipse.launch.LaunchConfigurationDelegate
> >
> > I also tried to change the expression to ("execution(* *.*(..))) just
> > to give a try... no success
> >
> > Any other ideas??
> >
> > Thanks all
> >
> > On 7/20/05, Alexandre Vasseur <[email protected]> wrote:
> > > Are you using the AspectWerkz Eclipse plugin with the AW nature turned on ?
> > > if so, yes you need an aop.xml file as explained in
> > > http://docs.codehaus.org/display/AW/Eclipse+plugin
> > >
> > > "For weaving to occur, the system needs to know which class is an
> > > aspect. Just as usual, this is done
> > > thru the META-INF/aop.xml descriptor.
> > > There is no requirements for this part. You just need to have one or
> > > more META-INF/aop.xml file in your classpath - be it the project
> > > itself or within a dependency jar file that may contains bundled
> > > aspects.
> > > A common practice is to have the project aop.xml file in the
> > > <project>/src/META-INF/aop.xml location."
> > >
> > > Alex
> > >
> > > On 7/20/05, Vinicius Carvalho <[email protected]> wrote:
> > > > Hello there! I've just started with AspectWerkz (I have some
> > > > background with AspectJ and AJDT and Spring AOP).
> > > >
> > > > Well, so I built the simplest example on eclipse 3.1 final:
> > > >
> > > > Here it is:
> > > >
> > > > package com.cs.aspects;
> > > >
> > > > public class HelloWorld {
> > > >
> > > >         /**
> > > >          * @param args
> > > >          */
> > > >         public static void main(String[] args) {
> > > >                 HelloWorld helloWorld = new HelloWorld();
> > > >                 helloWorld.greet();
> > > >         }
> > > >
> > > >         public void greet(){
> > > >                 System.out.println("Hello World");
> > > >         }
> > > >
> > > > }
> > > >
> > > > package com.cs.aspects;
> > > >
> > > > import org.codehaus.aspectwerkz.annotation.Before;
> > > > import org.codehaus.aspectwerkz.definition.Pointcut;
> > > > import org.codehaus.aspectwerkz.annotation.Expression;
> > > > import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
> > > >
> > > > public class HelloAspect {
> > > >         @Expression("* com.cs.aspects.HelloWorld.greet(...)")
> > > >         Pointcut myPointcut;
> > > >         @Before("myPointcut")
> > > >         public void beforeGreet(JoinPoint joinPoint) throws Throwable{
> > > >                 System.out.println(joinPoint.getCallee().getClass().getName());
> > > >         }
> > > >
> > > > }
> > > >
> > > > Well eclipse is not marking the method that has the joinpoint. I was
> > > > wondering if even if I'm using annotations, should I need an aop.xml
> > > > file? I tried with one and also no success. What am I missing here?
> > > >
> > > > Regards
> > > >
> > >
> >
>