I'm setting a Spring 3.2.3 + Hibernate 4 project in Eclipse 4.3.
When I add the code <tx:annotation-driven transaction-manager="transactionManager"/>
to my context I start getting the following error in every single bean:
Build path is incomplete. Cannot find class file for org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
Now, I added both AspectJ Tools and Cglib dependencies to my project and the JARs are there, including the class it can't find. The application runs normally, and Spring is managing sessions and transactions successfully.
I've searched for a solution but every answers says the error occurs because the lack of JARs.
Does anyone knows what I'm missing (incompatible versions?) or is this an Eclipse bug?
Here is a print screen of the problem (every error you'll see is the one I indicated above).
Thanks in advance!
Maybe you're missing som aspectj libs?
Try adding to your 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>
Ok, I finally found the solution to my problem!
When I installed the Spring Tools plugin it seems I forgot to check both "AspectJ Compiler" and "AspectJ Development Tools" from the plugin list. As soon as I installed and restarted the Eclipse, the errors disappeared.
Here's a print screen if someone interested:
Here's what worked for me:
I added to my POM.xml the dependencies Pere suggested in his answer:
org.aspectj
aspectjrt
1.7.3
org.aspectj
aspectjweaver
1.7.3
Then I right clicked on my project's name in Project Explorer --> properties --> java build path --> Order and Export tab.
In this tab I noticed that for some strange reason Maven Dependencies is no longer checked. I checked it, and after I applied the changes, the error mentioned in the question above disappeared.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With