spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration
详细错误代码:
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target [Bindable@5bf217b type = org.springframework.boot.autoconfigure.web.ResourceProperties, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(prefix=spring.resources, value=spring.resources, ignoreInvalidFields=false, ignoreUnknownFields=false)]] failed:
Property: spring.resources.cache-period
Value: 0
Origin: "spring.resources.cache-period" from property source "refresh"
Reason: The elements [spring.resources.cache-period] were left unbound.
Action:
Update your application's configuration
问题分析
何时出现?
- 添加完热部署依赖,spring-boot-devtools 启动报错
spring boot 版本:springBootVersion = '2.0.1.RELEASE'
devtools 版本:version: '1.5.12.RELEASE'
如何解决
既然报错有错误信息就有些头绪,不难发现:报错指向 spring.resources.cache-period
直接全局搜索:spring.resources.cache-period 发现 前三项都是 springboot 自动配置的 最后devtools 又要配置?

进入之后发现 果然 如报错信息所示:devtools 中静态块配置了spring.resources.cache-period 并且value 为 0

问题解决:
- 既然devtools 相关jar无法改变,那就是 springboot2.0后不支持老版的devtools ?
- 使用了新版(2.0.0.RELEASE 以上)的 devtools 发现源码将
spring.resources.cache-period换成了spring.resources.cache.period - 再次导入jar后 重启并不会报错!
总结:
- 遇到问题还是应该仔细看报错信息
- 多角度的分析 有利于问题的解决 而不是一直盯着一个
还有
- 记得刚加完热部署的依赖时候 启动并没有报错
- 一定是又改动了什么。
- 以后再说~
spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration的更多相关文章
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
- spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes
spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...
- 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level
解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...
- 【原创】大叔经验分享(67)spring boot启动报错
spring boot 启动报错: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback Logg ...
- 新建Spring boot 启动报错 Failed to auto-configure a DataSource
今天学习springboot,使用idea创建项目.在选择组件时添加了mysq 然后在第一次启动的时候启动报错,错误信息如下: ***************************APPLICATI ...
- Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
使用命令 java -jar springBoot.jar 启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...
- spring boot启动报错Error starting ApplicationContext(未能配置数据源)
主要错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource c ...
- spring boot 启动报错No active profile set, falling back to default profiles
报错No active profile set, falling back to default profiles pom.xml加上下面两个依赖 <dependency> <gro ...
- 学习Spring Boot:(五)使用 devtools热部署
前言 spring-boot-devtools 是一个为开发者服务的一个模块,其中最重要的功能就是自动应用代码更改到最新的App上面去.原理是在发现代码有更改之后,重新启动应用,但是比速度比手动停止后 ...
随机推荐
- STA分析(五) parastics
互联线的寄生参数 一般一个cell或者block的连接pin就叫做一个net.在物理实现的时候,一条net可能会穿过几层metal,因为每个metal层的电阻,电容值都不一样.所以,在分析 net的寄 ...
- 浅谈css中渐变衔接
无论transition还是keyframes,如何让变化更自然,这是前端应该考虑的问题. 这里,我简单总结下自己的方法. 以实践为例子. 1.图像渐变 @keyframes looppic{ fro ...
- Trove系列(三)—Trove的功能管理功能介绍
Trove的功能管理功能Trove的功能管理功能包括给各种不同的版本的 datastore 安装不同的 功能. 本管理功能只适用于激活/去活全系统的功能.唯一例外的是数据存储功能列表功能,该功能对所有 ...
- RocketMQ 集群搭建--双Master方案
安装环境 jdk1.7 alibaba-rocketmq-3.2.6.tar.gz VM虚拟机redhat6.5-x64:192.168.1.201 192.168.1.202 Xshell4 部署 ...
- python webdriver api-右键另存下载文件
右键另存下载文件 先编辑SciTE脚本: ;ControlFocus("title","text",controlID) ;表示将焦点切换到标题为title窗体 ...
- MyEclipse 相关设置
1. MyElipse复制项目后,修改项目的发布名称的方式.右击你的项目,选择 properties -- > MyElipse -- > web,然后修改名称即可. 2. IDE查看源代 ...
- Java SE 基础知识(String,Array)
String 类: 1. 对于String对象的相等性判断来说,请使用equals()方法,而不是==.String的equals()是判断当前字符串与传进来的字符串的内容是否一致. 2. Strin ...
- 机器学习、深度学习以及人工智能正在快速演进(ML、DL、AI)
机器学习.深度学习以及人工智能正在快速演进 机器学习.深度学习和人工智能(ML.DL和AI)是彼此相关的概念,他们正在改变不知多少行业,改变其自身管理模式,同时改变做出决策的方式.显然,ML.DL和A ...
- web前端----jQuery属性操作
知识点总结 1.属性 属性(如果你的选择器选出了多个对象,那么默认只会返回出第一个属性). attr(属性名|属性值) - 一个参数是获取属性的值,两个参数是设置属性值 - 点击加载图片示例 remo ...
- nw.js node-webkit系列(15)如何使用内部模块和第三方模块进行开发
原文链接:http://blog.csdn.net/zeping891103/article/details/50786259 原谅原版链接:https://github.com/nwjs/nw.js ...