【发布时间】:2014-11-01 02:33:35
【问题描述】:
谁能告诉我为什么使用spring boot时方面不会触发?我正在尝试使用 aspectj 设置加载时间编织,以便我可以建议私有方法。
这是准系统项目的链接 - https://github.com/satb/spring_aop_test_project.git
使用“-javaagent:path/to/spring-instrument-4.1.0.RELEASE.jar”(或您计算机上的其他版本的 lib)运行“App”类并运行 curl 命令
curl -i http://localhost:8080/test-app/motd
MyAspect 类有一个在调用 MyService 的私有方法时应该执行的通知。但在这种情况下,什么都不会发生。
当应用程序启动时,我看到如下消息:
[AppClassLoader@58644d46] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified.
我尝试按照这里的建议让它工作,但这没有帮助 - Using @Autowired with AspectJ and Springboot
【问题讨论】:
-
请不要重复同一个问题。我已经回答了the other one。
标签: spring aop spring-boot load-time-weaving