Whitelabel Error PageThis application has no explicit mapping for /error, spring and thymeleaf

异常信息:

Whitelabel Error 
PageThis application has no explicit mapping for /error, 
so you are seeing this as a fallback.

Sun May 13 17:18:55 CST 2018There was an unexpected error (type=Not Found, status=404).No message available

可能出现的原因:

1、pom 中对应的启动器未加入,在pom 中加入如下

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

</dependency>

2、浏览器中访问的地址不对,请检查是否配置了 server.context.path 是否访问时加上,可以打断点调试

3、可能是因为网速原因导致加载的jar 没有从网络上下载完整,我在build 的时候发现有几处错误如下:

    [ERROR] 读取E:\DevelopInstall\RepMaven\org\thymeleaf\thymeleaf\3.0.9.RELEASE\thymeleaf-3.0.9.RELEASE.jar时         出  错; invalid LOC header (bad signature)
   [ERROR] 读取E:\DevelopInstall\RepMaven\org\attoparser\attoparser\2.0.4.RELEASE\attoparser-2.0.4.RELEASE.jar时出       错; invalid LOC header (bad signature)

  [ERROR] 读取E:\DevelopInstall\RepMaven\org\unbescape\unbescape\1.1.5.RELEASE\unbescape-1.1.5.RELEASE.jar时出错; invalid LOC header (bad signature)

断定是jar 因为网速原因加载不完全所致,将本地的对应位置的jar 文件夹删除,然后将pom 中对应的依赖剪切保存重新加载即可


猜你喜欢

转载自blog.csdn.net/qq_33363618/article/details/80301275