繁体   English   中英

无法解析导入org.springframework.boot.autoconfigure.web.ErrorAttributes

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

我使用Spring Initializerembedded TomcatThymeleaf template engine和包作为可执行JAR文件生成了一个Spring Boot Web应用程序。

使用的技术:

Spring Boot 2.0.0.M6,Java 8,maven

但即使我在我的pom.xml中有这种依赖

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

我的项目中出现了这个编译错误:

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

尝试从中导入ErrorController

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

和ErrorAttributes

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

最新版本的春季启动不包含这个罐子。你可以按Ctrl + Shift + T然后检查这个类是否存在

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM