diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUriMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUriMethodArgumentResolver.java index 10259297f..02d58a968 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUriMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/BaseUriMethodArgumentResolver.java @@ -17,8 +17,8 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; */ public class BaseUriMethodArgumentResolver implements HandlerMethodArgumentResolver { - @Autowired - private RepositoryRestConfiguration config; + @Autowired(required = false) + private RepositoryRestConfiguration config = RepositoryRestConfiguration.DEFAULT; @Override public boolean supportsParameter(MethodParameter parameter) { return (RepositoryRestController.class.isAssignableFrom(parameter.getDeclaringClass()) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PagingAndSortingMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PagingAndSortingMethodArgumentResolver.java index ab0a9fb7b..b34ef4324 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PagingAndSortingMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/PagingAndSortingMethodArgumentResolver.java @@ -27,8 +27,8 @@ public class PagingAndSortingMethodArgumentResolver implements HandlerMethodArgu private static final int DEFAULT_PAGE = 1; // We're 1-based, not 0-based - @Autowired - private RepositoryRestConfiguration config; + @Autowired(required = false) + private RepositoryRestConfiguration config = RepositoryRestConfiguration.DEFAULT; @Override public boolean supportsParameter(MethodParameter parameter) { return ClassUtils.isAssignable(parameter.getParameterType(), PagingAndSorting.class);