I was successfully using @EnableSpringDataWebSupport
in my Spring Boot app to enable pagination, sorting and stuff. However, at some point, I had to introduce a custom argument resolver and did it with Java config as follows:
@Configuration
@EnableSpringDataWebSupport
public class MvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(renamingProcessor());
}
@Bean
protected RenamingProcessor renamingProcessor() {
return new RenamingProcessor(true);
}
}
It made my new argument resolver work, however completely broke paging and other features, that were automatically configured by @EnableSpringDataWebSupport
. I've tried switching WebMvcConfigurerAdapter
to alternatives like DelegatingWebMvcConfiguration
or WebMvcConfigurationSupport
, but no luck -- pagination fails with the exception:
Failed to instantiate [org.springframework.data.domain.Pageable]: Specified class is an interface
I would appreciate any help or advice how to handle this issue. Similar questions didn't help a lot: