Community

jboss aop in eclipse - can't make it work

created by Aram Hovsepyan in JBoss AOP - View the full discussion

Hi,

 

I've just started digging into the jboss AOP, however its been 2 days and I just can't make the most trivial helloworld work. The documentation I've found so far did not help. I'd appreciate a lot if someone would tell me what am I doing wrong. The application is exported to .war and placed in the deploy directory.

I've added -Djboss.aop.verbose=true to JAVA_OPTS and it doesn't produce anything.

 

Here is what i have:

- org.kuleuven.Test.java

- org.kuleuven.TestAspect.java

- WebContent/META-INF/jboss-aop.xml

+ some stuff that's not relevant

 

the jboss server is version 5.1 and has jboss.aop running.

 

In Test.java I have:

...

public void testing()

{

//aspect should execute here

System.out.println("testing");

}

...

 

The TestAspect.java:

public class TestAspect implements Interceptor {

public String getName() {

return "HelloWorldInterceptor";

}

public Object invoke(Invocation inv) throws Throwable {

System.out.println("Aspect interception");

return inv.invokeNext();

}

}

and the jboss-aop.xml:

<?xml version="1.0" encoding="UTF-8"?>

<aop xmlns="urn:jboss:aop-beans:1.0">

<aspect class="org.kuleuven.TestAspect" scope="PER_VM"/>

<bind pointcut="execution(public void org.kuleuven.Test->testing())">

<advice name="test" aspect="org.kuleuven.TestAspect"/>

   </bind>

</aop>

 

thnx a lot

Reply to this message by going to Community

Start a new discussion in JBoss AOP at Community