Re: [aspectwerkz-user] Eclipse integration using annotations
Vinicius Carvalho <[email protected]> Wed, 20 Jul 2005 08:04:04 -0300
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
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
> >
>