【问题标题】:ApplicationEventMulticaster not initialized with Spring HATEOAS未使用 Spring HATEOAS 初始化 ApplicationEventMulticaster
【发布时间】:2017-12-03 02:36:02
【问题描述】:

我尝试使用 Spring HATEOAS 中的 EntityLinks 概念。

通过在 Spring MVC 配置中激活 @EnableEntityLinks,EntityLinks 可用于依赖注入。

我就是这样做的:

@Configuration
@EnableEntityLinks
@ComponentScan(basePackages = { "de.sample.test" })
public class WebMvcConfig extends WebMvcConfigurerAdapter {
       ...
}

现在如果我启动应用程序,我会收到以下错误:

java.lang.IllegalStateException:ApplicationEventMulticaster 未初始化 - 在通过上下文多播事件之前调用“刷新”:org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7869d479:启动日期 [星期四 6 月 29 日 13:42:58 CEST 2017];上下文层次结构的根

如果没有注释,应用程序将启动,但我没有 EntityLinks 支持。

有什么建议吗?提前致谢

【问题讨论】:

    标签: spring spring-mvc spring-hateoas


    【解决方案1】:

    我只是忘记了 data-rest-webmvc 依赖项。在我遵循的教程中没有提到这一点。

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-rest-webmvc</artifactId>
    </dependency>
    

    【讨论】:

      猜你喜欢
      • 2012-05-11
      • 1970-01-01
      • 2015-10-21
      • 1970-01-01
      • 1970-01-01
      • 2015-06-22
      • 1970-01-01
      • 1970-01-01
      • 2014-12-19
      相关资源
      最近更新 更多