I try to use the EntityLinks concept from Spring HATEOAS.
EntityLinks is available for dependency injection by activating @EnableEntityLinks in your Spring MVC configuration.
I do it just like that:
@Configuration
@EnableEntityLinks
@ComponentScan(basePackages = { "de.sample.test" })
public class WebMvcConfig extends WebMvcConfigurerAdapter {
...
}
Now if I start the application I get the following error:
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7869d479: startup date [Thu Jun 29 13:42:58 CEST 2017]; root of context hierarchy
Without the annotation the application starts but I have no EntityLinks support.
Any suggestions? Thanks in advance
I simple forget the data-rest-webmvc dependency. That wasn't mention in the tutorials I followed.
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-webmvc</artifactId>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With