0

我有一个spring-boot项目。当我尝试启动应用程序时,我遇到了以下问题。

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@78b1cc93: startup date [Mon Nov 06 13:01:13 UTC 2017]; root of context hierarchy

在我的研究中,我发现了一个听起来与我的问题完全一样的错误报告。

https://jira.spring.io/browse/SPR-16149

问题似乎是某种未正确处理的较低级别的异常。从外观上看,这是一个不应该在用户空间中看到的异常。也有一个修复它。伟大的!我对修复做了一些更多的研究,结果证明你可以独立于 sprig boot 升级你的 spring 版本。我已将以下内容应用于我的 build.gradle

ext['spring.version'] = '4.3.13.RELEASE'

但是,当我尝试使用这个新版本启动应用程序时,我得到以下信息。

gradle@2eb4803b9c11:/app$ gradle bootRun

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter//spring-boot-starter-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter//spring-boot-starter-.jar
      https://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter//spring-boot-starter-.pom
      https://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter//spring-boot-starter-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-data-jpa:.
  Required by:
      project :
> Could not find org.springframework.cloud:spring-cloud-starter-stream-rabbit:.
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
1 actionable task: 1 executed

看来我的项目无法再解析 spring-boot-starter 了。我读对了吗?为什么我不能更新我的spring版本并使用现有版本的spring boot?它们有什么关系?

4

1 回答 1

0

Maven 中央存储库中没有4.3.13.RELEASE可用的版本。最新版本的 spring 是5.0.1.RELEASE.

于 2017-11-07T02:06:36.807 回答