java - 使用spring-boot-devtools时报错?

 添莺_764 发布于 2022-10-27 17:33

报错信息

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor' defined in class path resource [org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]: 
Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]:
 No qualifying bean of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] found for dependency: 
expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {};
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] 
found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]
 found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

我的配置主要是:
`

    org.springframework.boot
    spring-boot-starter-parent
    1.3.3.RELEASE


    org.springframework.boot
    spring-boot-devtools
`

idea中设置了
1.settings-->Complier--->勾选Make Project Automatically
2.Shift+Ctrl+Alt+/,选择Registry,勾选compiler.automake.allow.when.app.running
本地仓库也有了spring-boot-devtools的jar包;我自建的springboot项目使用的是1.4版本可以成功,但是在我们现在开发的项目中集成失败

1 个回答
  • a)对应的spring-boot版本是否正确,我这里使用的是1.3.3版本;

    b)是否加入plugin了,以及属性<fork>true</fork>

    c)Eclipse Project 是否开启了Build Automatically(我自己就在这里栽了坑,不知道为什么我的工具什么时候关闭了自动编译的功能)。

    d)如果设置SpringApplication.setRegisterShutdownHook(false),则自动重启将不起作用。

    2022-10-28 15:22 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有