Vihar
Vihar

Reputation: 3831

AOP pointcut error

I am using AOP in my application and need to define a pointcut, I am doing that with spring configuration

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

but I am getting the exception

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

what I am doing wrong here?

Upvotes: 0

Views: 329

Answers (1)

kazbeel
kazbeel

Reputation: 1436

Bearing in mind the information you have provided, I've got two ideas:

  1. Is the class that contains logMethod an @Aspect?
  2. <aop:around pointcut-ref="pointCut" method"logMethod" /> Notice the pointcut-ref.

I believe the latter is the right one but, can't check it now.

Upvotes: 1

Related Questions