小编典典

找不到org.aspectj.weaver.reflect.ReflectionWorld

spring

我正在Eclipse 4.3中设置一个Spring 3.2.3 + Hibernate 4项目。

当我将代码添加<tx:annotation-driven transaction-manager="transactionManager"/>到上下文中时,我开始在每个bean中收到以下错误:

Build path is incomplete. Cannot find class file for org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException

现在,我在项目中添加了AspectJ Tools和Cglib依赖项,并且JAR在那里,包括它找不到的类。该应用程序正常运行,并且Spring正在成功管理会话和事务。

我一直在寻找解决方案,但每个答案都指出,由于缺少JAR,因此会发生错误。

有谁知道我缺少的内容(不兼容的版本?),或者这是Eclipse错误?

这是问题的打印屏幕(你会看到的每个错误都是我上面指出的错误)。


阅读 579

收藏
2020-04-21

共2个答案

小编典典

也许你缺少Som AspectJ库?

尝试添加到pom

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.7.3</version>    
</dependency>
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.7.3</version>
</dependency>
2020-04-21
小编典典

好的,我终于找到了解决我问题的方法!

当我安装Spring Tools插件时,似乎忘记了从插件列表中同时检查“ AspectJ编译器”和“ AspectJ开发工具”。一旦我安装并重新启动Eclipse,错误就消失了。

2020-04-21