Spring - the build path is incomplete. Cannot find class file for org / springframework / beans / factory / Aware in dispatcher-servlet.xml

I installed Spring Tool Suite and now use it for a small sample project. However, I save the error in the dispatcher-servlet.xml file:

Build path is incomplete. Cannot find class file for org/springframework/beans/factory/Aware 

This error stands out here:

 <bean **class="org.springframework.web.servlet.view.InternalResourceViewResolver">** <property name="prefix"> <value>/WEB-INF/pages/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> 

Any thought?

+4
source share
5 answers

I think you may have old jar files in your configuration. Try using the latest spring libraries.

+5
source

I found myself in the same case when I used incompatible maven spring dependencies, that is, the Spring security site on the right side, which explains which version of spring should be used with the spring security version.

+1
source

There is no servlet-api jar parameter in the project, and the error can be resolved by adding a dependency in the maven pom file

  <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> 
0
source

you can put this dependency with your spring version:

  <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring-version}</version> <scope>compile</scope> </dependency> 
0
source

If you are using eclipse :

  • Right click on the root project -> properties.
  • Click on the deployment node.
  • Click the Add button.
  • Double-click on the lines of the Java Build Path and select the path to build the record. (maybe if you are using maven, you also need to include these dependencies).
  • Finally, clean and build.

It worked for me.

0
source

Source: https://habr.com/ru/post/1441932/


All Articles