ApplicationEventMulticaster not initialized with Spring HATEOAS

I am trying to use the EntityLinks concept from Spring HATEOAS.

EntityLinks is available for dependency injection by activating @EnableEntityLinks in Spring MVC config.

I do it just like this:

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

      

Now if I run the application I get the following error:

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicast events via context: org.springframework.boot .context.embedded.AnnotationConfigEmbeddedWebApplicationContext @ 7869d479: start date [Thu Jun 29] 13:42:58 CEST 2017 context hierarchy root

Without the annotation, the application starts, but I don't have EntityLinks support.

Any suggestions? thanks in advance

+3


source to share


1 answer


I am just forgetting the data-rest-webmvc dependency. This was not mentioned in the tutorials I followed.



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

      

+1


source







All Articles