Spring Boot:重新启动器未初始化 [英] Spring Boot : restarter not initialized

查看:207
本文介绍了Spring Boot:重新启动器未初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当春季启动版本为 1.5.3.RELEASE 时,启动应用程序时出现以下错误

When the spring boot version is 1.5.3.RELEASE, I got the following error while starting the application

堆栈跟踪:

java.lang.IllegalStateException: Restarter has not been initialized
    at org.springframework.util.Assert.state(Assert.java:392) ~[spring-core-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.boot.devtools.restart.Restarter.getInstance(Restarter.java:563) ~[spring-boot-devtools-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationPreparedEvent(RestartApplicationListener.java:75) ~[spring-boot-devtools-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:48) ~[spring-boot-devtools-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:85) ~[spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:66) ~[spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE]
    at com.*.SpringBootWebApplication.main(SpringBootWebApplication.java:17) [classes/:na]

NB :当版本更改为 1.4.2.RELEASE 时,它可以正常工作,并且不会引发上述异常

NB: when the version is changed to 1.4.2.RELEASE, it works fine and didn't throw the above exception

推荐答案

由于工件的版本存在问题.删除pom.xml中 org.springframework.boot spring-boot-devtools 中的版本.

Problem exist due to version of artifact. Remove the version in org.springframework.boot spring-boot-devtools in pom.xml.

内部pom.xml

<dependencies>
      <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-devtools</artifactId>
      </dependency>
  <dependencies>

内部build.gradle文件

Inside build.gradle file

dependencies {
    compile "org.springframework.boot:spring-boot-devtools" 
}

这篇关于Spring Boot:重新启动器未初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆