JBoss Community

Jboss AOP loads but doesnt seem to be working

created by Tino Sainz in JBoss AOP - View the full discussion

Hello,

 

This its my first AOP project (porting from AspectJ) and i followed this guide (a little):

http://java.dzone.com/news/an-introduction-aspect-oriente?page=0,1

 

I put the javaagent pointing to jboss-aop-single.jar (download aop today, so lastest GA version). <- Using Load time weaving

 

<aop>

   <aspect class="main.customHibernateAOP"/>

 

 

   <bind pointcut="execution(void pruebahibernate_1.ManejadorLibro2->pruebas())">

                    <around aspect="main.customHibernateAOP" name="inicializa"/> 

          </bind>

</aop>

 

Using that jboss-aop.xml (it gets loaded, and main.customHibernateAOP its also found) i get no errors, if i change for example main.customHibernateAOP to main.ajajdjasj i'll get class not found there, so jboss-aop.xml and classes are fine (not classpath problem i think).

 

 

My problem is that it does absolutely nothing (doesnt print to out)

 

 

 

 

public class customHibernateAOP {

 

 

    public Object inicializa(MethodInvocation invocation) throws Throwable{

               System.out.println("Awwwwwwwiniciww\n\n\n\n"); <-- It never prints on console

          return invocation.invokeNext();

    }

 

}

 

That's my method.

 

My class its pruebahibernate_1.ManejadorLibro2

 

and method its

 

public void pruebas() {

System.out.println("Im here"); (this one does show on console)

...}

 

 

I have a more complex pointcut (the one im really porting) also there and not working.

 

 

Any help?, thanks

Reply to this message by going to Community

Start a new discussion in JBoss AOP at Community