今天在eclipse测试spring代码的时候,遇到了Pointcut is not well-formed: expecting '(' at character position 0 aspect1。
junit的报错如下
failed to load applicationcontext
eclipse控制台的报错如下
Pointcut is not well-formed: expecting '(' at character position 0 aspect1
通过它的错误信息,我知道它的报错就在切入点附近,可是我一直查看execution表达式,发现没毛病啊。
package com.yc.spring.aop; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.springframework.context.annotation.ComponentScan; import org.springframework.stereotype.Component; @Aspect @Component public class MyAspect { @Pointcut("execution(* com.yc.dao.MySqlUserDaoImpl.*(..))") public void aspect1() { } @Before("aspect1") public void before() { System.out.println("==========增强======="); } }