The import org.springframework.boot.autoconfigure.web.ErrorAttributes cannot be resolved

Viewed 7734

I've generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.

Technologies used:

Spring Boot 2.0.0.M6 , Java 8, maven

but even I have this dependency in my pom.xml

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
</dependency>

I got this compilation error in my project:

 The import org.springframework.boot.autoconfigure.web.ErrorAttributes cannot be  resolved
 The import org.springframework.boot.autoconfigure.web.ErrorController cannot be resolved
2 Answers

Try to import ErrorController from

org.springframework.boot.web.servlet.error.ErrorController

and for ErrorAttributes

import org.springframework.boot.web.servlet.error.ErrorAttributes;

Latest version spring boot doesn't contain this jars.Can you do Ctrl+Shift+T then check whether this class is there or not

Related