2015-01-16 44 views
0

我使用AOP在我的應用程序,需要定義一個切入點, 我做的是帶彈簧的配置AOP切入點錯誤

<aop:aspect id="aspect" ref="loggerBean"> 
    <aop:pointcut id="pointCut" expression="execution(public * *(..))" /> 
    <aop:around pointcut="pointCut" method="logMethod" /> 
</aop:aspect> 

,但我得到異常

Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting '(' at character position 0 
pointCut 
^ 

我我在這裏做錯了嗎?

+1

在你的'aop:around''pointcut'應該是'pointcut-ref'。 –

+0

我怎麼會錯過這樣一個愚蠢的觀點,我已經讓bean需要使用'ref',謝謝指出它。 – Vihar

回答

1

銘記您所提供的信息,我有兩個想法:

  1. 是包含logMethod一個@Aspect類?
  2. <aop:around pointcut-ref="pointCut" method"logMethod" />注意pointcut-ref

我相信後者是正確的,但現在無法檢查。

+0

我怎麼會錯過這樣一個愚蠢的問題,我已經使bean需要使用'ref',謝謝指出它。 – Vihar