详细错误代码:

***************************
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的更多相关文章

  1. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

  2. 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 ...

  3. 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

    解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...

  4. 【原创】大叔经验分享(67)spring boot启动报错

    spring boot 启动报错: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback Logg ...

  5. 新建Spring boot 启动报错 Failed to auto-configure a DataSource

    今天学习springboot,使用idea创建项目.在选择组件时添加了mysq 然后在第一次启动的时候启动报错,错误信息如下: ***************************APPLICATI ...

  6. 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 ...

  7. spring boot启动报错Error starting ApplicationContext(未能配置数据源)

    主要错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource c ...

  8. spring boot 启动报错No active profile set, falling back to default profiles

    报错No active profile set, falling back to default profiles pom.xml加上下面两个依赖 <dependency> <gro ...

  9. 学习Spring Boot:(五)使用 devtools热部署

    前言 spring-boot-devtools 是一个为开发者服务的一个模块,其中最重要的功能就是自动应用代码更改到最新的App上面去.原理是在发现代码有更改之后,重新启动应用,但是比速度比手动停止后 ...

随机推荐

  1. Instruments(性能调优 12.3)

    Instruments Instruments是Xcode套件中没有被充分利用的一个工具.很多iOS开发者从没用过Instruments,或者只是用Leaks工具检测循环引用.实际上有很多Instru ...

  2. Linux基础命令---cat

    cat 连接文本文件或者标准输入,将结果输出到标准输出设备. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.SUSE.openSUSE.Fedora. 1.语法       c ...

  3. 火狐使用Ctrl新开窗口不生效

    使用window.open新开页面,火狐浏览器无法使用Ctrl新开窗口后页面停留在当前页面,兼容性问题,使用<a>或者<router-link>标签即可解决 --贡献者:毛毛

  4. P2158/bzoj2190 [SDOI2008]仪仗队

    P2158 [SDOI2008]仪仗队 欧拉函数 计算下三角的点数再*2+1 观察斜率,自行体会 #include<iostream> #include<cstdio> #in ...

  5. Python3.x(windows系统)安装requests库

    Python3.x(windows系统)安装requests库 cmd命令: pip install requests 执行结果:

  6. 一个远程启动windows c++程序引发的技术决策现象

    还是因为那个8点半前要启动近百套报盘程序的问题,差不多两周前表示自己会抽空给解决掉,一次性启动,直到昨天才差不多能够抽点时间出来开始想怎么解决的问题. 这个问题的复杂点在于除了启动exe外,还需要鼠标 ...

  7. velocity #parse抽象重用部分组件

    在某些时候,处于重用的目的,我们会选择将可以重用的部分内容剥离在单独的模板文件中,比如对于查询页面的表格部分,因为现在很多的条件可能是通过弹出查询框的方式来实现,而作为普通页面的时候,他们会有更多的功 ...

  8. html/jquery最实用功能与注意点

    获取某元素的父元素 通常用在根据被click的td获取tbody时. parent是指取得一个包含着所有匹配元素的唯一父元素的元素集合.parents则是取得一个包含着所有匹配元素的祖先元素的元素集合 ...

  9. Android移植学习笔记

    1.一头雾水不知道用什么编译环境,不知道用什么下载软件 编译软件:Ubuntu12.04(编译主机系统),JDK(Java) 下载软件: 模拟器: qemu

  10. bzoj 3505 数三角形 - 组合数学

    给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个.下图为4x4的网格上的一个三角形. 注意三角形的三点不能共线. Input 输入一行,包含两个空格分隔的正整数m和n. Output 输出 ...