[jboss-user] [JBoss AOP] New message: "Tried everything to get Interceptor working, what am I missing?"

Nick Dodd do-not-reply at jboss.com
Mon Feb 1 07:48:40 EST 2010

User development,

A new message was posted in the thread "Tried everything to get Interceptor working, what am I missing?":


Author  : Nick Dodd
Profile : http://community.jboss.org/people/baronDodd

I am losing the will to live with aop. Just trying to get a simple hello world Interceptor working by intercepting public methods. Using JBoss 4.3.0, have already given up on using annotations and instead gone for the xml approach.
My Interceptor:
public class MyInterceptor implements Interceptor {
     public Object invoke (Invocation invocation) throws Throwable {
         try {
              System.out.println("Enter the joinpoint");
           return invocation.invokeNext ();
         } finally {
           System.out.println("Leave the joinpoint");
     public String getName() {
          return "my.packages.MyInterceptor";

My *-aop.xml in which out of desperation I am attempting to intercept all public methods as this is the only thing that creates any output:
<?xml version="1.0" encoding="UTF-8"?>
   -//JBoss//DTD JBOSS AOP 1.0//EN
<interceptor class="my.packages.MyInterceptor" scope="PER_VM"/>

<bind pointcut="execution(public * *->*(..))">
      <interceptor-ref name="my.packages.MyInterceptor"/>


The only output I get is from Intercepting some jms classes:
12:29:35,466 INFO  [STDOUT] Enter the joinpoint
12:29:35,468 INFO  [STDOUT] class org.jboss.jms.client.delegate.ClientSessionDel
12:29:35,469 INFO  [STDOUT] Leave the joinpoint
12:29:35,470 INFO  [STDOUT] Enter the joinpoint
12:29:35,471 INFO  [STDOUT] class org.jboss.jms.client.delegate.ClientProducerDe
12:29:35,472 INFO  [STDOUT] Enter the joinpoint
12:29:35,473 INFO  [STDOUT] class org.jboss.jms.client.delegate.ClientSessionDel
12:29:35,474 INFO  [STDOUT] Enter the joinpoint
12:29:35,475 INFO  [STDOUT] class org.jboss.jms.server.endpoint.advised.SessionA
12:29:35,476 INFO  [STDOUT] Leave the joinpoint
12:29:35,477 INFO  [STDOUT] Leave the joinpoint
I am compiling my code with the aopc
Any ideas? I am clearly missing something here.


To reply to this message visit the message page: http://community.jboss.org/message/523344#523344

More information about the jboss-user mailing list