I followed a simple tutorial to test the behavior of the rest of the spring data, with annotating the repository with @RestResource annotation. I have a very simple scenario: Jpa User Entity and UserRepository annotated with @RestResource
@RestResource(path="users", rel="users")
public interface UserRepository extends PagingAndSortingRepository<User, Long> {
List<User> findUserByUserName(@Param("userName")String userName);
}
I am using annotation configuration initialization, and I am trying to register RepositoryRestMvcConfiguration, so UserRepository can be registered. But my application does not start, and I have the following exception.
INFO Registering annotated classes: [class org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration,class com.ncau.WebMvcConfiguration]
ERROR Context initialization failed
java.lang.ClassCastException: [Lorg.springframework.hateoas.config.EnableHypermediaSupport$HypermediaType; cannot be cast to org.springframework.hateoas.config.EnableHypermediaSupport$HypermediaType
at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions(HypermediaSupportBeanDefinitionRegistrar.java:90) ~[spring-hateoas-0.8.0.RELEASE.jar:na]
I am using spring -hateoas: 0.8.0.RELEASE spring -data-rest-webmv: 2.0.0.RC1 spring -framework: 4.0.0.RELEASE spring -data-JPA: 1.4.3
mejas source
share