试图构建简单的aop项目
错误是由: java.lang.IllegalArgumentException:切入点不是格式良好的:期待>>>'(‘在字符位置0
p1
所有的导入和包都是正确的,我检查了一下.
@Aspect
@Component
public class TxService {
@Pointcut("execution(public void com.boot.aop.dao.EmployeeDao.saveEmployee())")
public void p1() {
}
@Before("p1")
public void beginTx() { // advice
System.out.println("Transaction is started");
}发布于 2022-07-14 20:05:52
正如错误信息所述,切入点不是很好的格式。更准确地说,切点引用不是。实际的切点看起来没问题。请使用:
@Before("p1()")别忘了括号!
https://stackoverflow.com/questions/72984417
复制相似问题