What dependency am I missing? I am currently using:
org.springframework
spring-w
I think You are using Spring 3.0.5 and you need to use Spring 4.0.* This will resolve your problem. org.springframework.web.bind.annotation.RequestMapping is not available in Spring-web earlier then Spring-web 4.0.*
Thanks above all of you contributions! however for my case I finally realized that my dependency above "spring-web" was destroyed on my .m2/repository/org/springframework/spring-web, I just deleted the folder and update Maven again. it got fixed.
Step 1 - The problem is with Eclipse IDE Step 2 - Right Click Maven Dependencies -> Build Path -> Remove Build Path
Update pom.xml for spring-web and spring-webmvc
Step 3 - Update Maven Dependencies
You will see the Spring-Web files will be in the maven dependencies folder.
I had the same problem. After spending hours, I came across the solution that I already added dependency for "spring-webmvc" but missed for "spring-web". So just add the below dependency to resolve this issue. If you already have, just update both to the latest version. It will work for sure.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
You could update the version to "5.1.2" or latest. I used V4.1.6 therefore the build was failing, because this is an old version (one might face compatibility issues).
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
I was using spring-web version 4.3.7
Changing it to a working 4.1.7 immediately solved it.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>