org.aspectj.lang.NoAspectBoundException-未找到方法< init>()V [英] org.aspectj.lang.NoAspectBoundException - method <init>()V not found

查看:600
本文介绍了org.aspectj.lang.NoAspectBoundException-未找到方法< init>()V的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了与 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-未找到方法&lt; init&gt;()V的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆