org.aspectj.lang.NoAspectBoundException

编程入门 行业动态 更新时间:2024-10-11 07:31:21
本文介绍了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

本文发布于:2023-11-25 06:39:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628708.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:aspectj   org   NoAspectBoundException   lang

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!