Cannot find org.aspectj.weaver.reflect.ReflectionWorld

12,731

Solution 1

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:

enter image description here

Solution 2

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>

Solution 3

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.

Share:
12,731
João Simões
Author by

João Simões

Currently working as a technology consultant, João Simões is responsible for planning and designing the architecture of large scale applications which, due to clients business requirements, normally fall into web services (REST or SOAP) or websites, but desktop and mobile are also common. João Simões loves technology (probably too much for his own sake) which, in conjunction with the experience gains through such a wide range of projects, allows him to gain extensive knowledge in some of the most commonly used programming languages, being great examples Java, C#, Javascript, SQL, C/C++ or Objective-C. While using all this languages, he also gained expertise in frameworks like ASP.NET MVC, ASP.NET Web API, WCF, WPF, Entity Framework, jQuery, Spring Framework, jBPM, Liferay and more. When it comes to persisting information, João Simões knows SQL databases extremely well, specially MySQL, SQL Server and Oracle, while having some knowledge about NoSQL databases, like MongoDB. Technology aside, he tries his best to stay updated with the latest news about science, especially when it comes to physics, and economy because, well, someone has to pay the bills! He also maintains his personal blog - João Simões.Net - being the place where he experiments new technologies and shares experience.

Updated on June 04, 2022

Comments

  • João Simões
    João Simões almost 2 years

    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).

    enter image description here

    Thanks in advance!

  • azec-pdx
    azec-pdx almost 10 years
    I had same issue using spring-aop 3.2.8. This class is actually inside org.aspectj.aspectjweaver artifact, but I was using wrong version 1.7.4
  • Zahid Khan
    Zahid Khan over 8 years
    this answer Solved my Problem as STS shows error on all of my bean classes. But the project runs without any errors. Just did this to remove errors from the xml file. Did'nt add any extra dependency.
  • Mithun Debnath
    Mithun Debnath over 7 years
    if you are working with sts,plsease add this dependency also along with above two(if not added) <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>2.2</version> </dependency>