Hi again, although anybody answer my questions I still try that JbossAOP works for me.

How I've not get that an application under Tomcat with JBossAOP works fine, then I'm 
going
to try n standalone application.

Main class:


package es.pfc.test;

public class TestAOP {

    public TestAOP() {

        super();

    }

    public void execute() {

        System.out.println("Test de AOP");

    }

    public static void main(String[] args) {
        try {

            new TestAOP().execute();

        } catch (Throwable th) {

            th.printStackTrace();

        }
    }
}


Interceptor class:

package es.pfc.test.aop;

import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;

public class MethodAuthorizationInterceptor implements Interceptor {

    public String getName() {

        return getClass().getName();

    }

    public Object invoke(Invocation invocation) throws Throwable {

        MethodInvocation mInvocation = (MethodInvocation) invocation;
        String method = mInvocation.getMethod().getName();
        System.out.println("Interceptado el metodo - " + method);
        return invocation.invokeNext();

    }
}


jboss-aop.xml file:

<?xml version="1.0" encoding="UTF-8"?>
< aop>
    < bind pointcut="execution(public * es.pfc.test.*->*(..))">
        < interceptor class="es.pfc.test.aop.MethodAuthorizationInterceptor"/>
    < /bind>
< /aop>


When I run TestAOP I get this message:

Exception in thread "main" java.lang.StackOverflowError

I've not got any stack trace. What's wrong in my test?


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841184#3841184

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841184


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to