原报错信息
这里只是截取核心报错信息,如下: java.lang.IllegalArgumentException: error at ::0 can\'t find referenced pointcut
aused by: java.lang.IllegalArgumentException: error at ::0 can\'t find referenced pointcut peforms
at org.aspectj.weaver.tools.PointcutParser.parsePointcut (PointcutParser.java:319)
at org.spring work.aop.aspectj.AspectJ Pointcut.buildPointcut
解决方案
方案一,按照网上主流解决方式,调整JDK包和AspectJ包的版本,
如果要使用AspectJ完成注解切面需要注意下面的JDK与AspectJ的匹配:
JDK1.6 —— aspectJ1.6
JDK1.7 —— aspectJ1.7.3+
具体的包,请去网络网上自行下载。这种方案对我无效,我调整了大半天,没用。那个美丽的绿色条条没出现。
方案二:修改代码逻辑,替换@Pointcut部分
@Pointcut() 部分重写,具体的可以看我代码片段部分
/*
@Pointcut(\"execution(** com.bert.concert.interfaces.Performance.perform(..))\")
public void performs() {}
*/
@Before(\"execution(** com.bert.concert.interfaces.Performance.perform(..)) \")
public void silencePhone() {
System.out.println(\"Please close off your cellphone .\");
}
@Before(\"execution(** com.bert.concert.interfaces.Performance.perform(..))\")
public void takeSeat() {
System.out.println(\"Please take a seat in five minutes.\");
}
@AfterReturning(\"execution(** com.bert.concert.interfaces.Performance.perform(..))\")
public void applause() {
System.out.println(\"Clap clap ...\");
}
@AfterThrowing(\"execution(** com.bert.concert.interfaces.Performance.perform(..))\")
public void demandRefund() {
System.out.println(\"It is too bad ...Ehh\");
}
欢迎持续关注我的博客,我会在某一篇博客公开自己阶段性总结的代码报错文档
继续阅读与本文标签相同的文章
下一篇 :
教你如何通过快捷手势选中多条消息进行删除!
-
零售电商月销售额高达20+万?小程序分销模式助你一臂之力
2026-05-18栏目: 教程
-
如何让日志说话,让它主动说话
2026-05-18栏目: 教程
-
《Android组件化架构》| 每日读本书
2026-05-18栏目: 教程
-
从零开始入门 K8s | 详解 K8s 容器基本概念
2026-05-18栏目: 教程
-
8年前诞生于淘宝,细数阿里云RPA 的前世今生!
2026-05-18栏目: 教程
