java - 使用spring-boot-devtools时报错?
迷茫
迷茫 2017-04-18 10:25:35
0
1
1061

报错信息

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: {}

我的配置主要是:
` <parent>

    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.3.RELEASE</version>
</parent>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>`

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) 플러그인이 추가되었는지 여부와 <fork>true</fork>

속성이 추가되었는지 여부

c) Eclipse 프로젝트가 자동으로 빌드를 켰는지 여부(나도 여기서 함정에 빠졌는데, 왜 내 도구가 자동 컴파일 기능을 껐는지 모르겠습니다).

d) SpringApplication.setRegisterShutdownHook(false)가 설정된 경우 자동 재시작이 작동하지 않습니다.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿