我遇到了与 vanhre相同的问题在春季论坛上问过,但就我而言,我无法更改构造函数.
I had same problem as vanhre asked in Spring forum, but in my case I couldn't change the constructor.
我使用的是Spring java配置,因此在码头启动期间它可以初始化,但是在运行时,当我用自己的方面执行该功能时,由于论坛中完全相同的异常而失败.
I'm using Spring java configuration, so it was initializing ok during jetty start, but in runtime, when I executed the functionality with my aspect it failed with exactly the same exception from the forum.
推荐答案我后来发现,我需要在pom中使用aspectjrt依赖项.
I found later, that I need aspectjrt dependency in my pom.
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.12</version> </dependency>编辑:缺少依赖项是一个错误,但是真正的问题是Eclipse + Aspects组合.当我使用Eclipse构建我的方面类时,发生了此错误.此外,当我编译类时,方面建议是针对方面的,未调用方面.
edit: Missing dependency was an error, but real problem is Eclipse + aspects combination. When I used Eclipse to build my aspect class this error occurred. Additionally when I compiled class the aspect advice was for, aspect was not called.
解决方案:,您必须使用maven来构建您的应用程序(如果有人找到Eclipse的解决方案,我会很高兴,因为我敢肯定会忘记这一点)
solution: you have to use maven to build your application (I'd be glad if someone find solution for Eclipse, because I'm sure I'll forget this)
更多推荐
org.aspectj.lang.NoAspectBoundException
发布评论