Spring data rest exception
See original GitHub issuePlease take the time to search the repository, if your question has already been asked or answered.
- 2.9.0
What kind of issue is this?
- springfox data rest can not init with spring data rest 2.0.7
Caused by: java.lang.NoSuchMethodError: org.springframework.data.repository.support.Repositories.getRepositoryInformationFor(Ljava/lang/Class;)Lorg/springframework/data/repository/core/RepositoryInformation;
at springfox.documentation.spring.data.rest.EntityServicesProvider.requestHandlers(EntityServicesProvider.java:81) ~[springfox-data-rest-2.9.0.jar:2.9.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper$2.apply(DocumentationPluginsBootstrapper.java:138) ~[springfox-spring-web-2.9.0.jar:2.9.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper$2.apply(DocumentationPluginsBootstrapper.java:135) ~[springfox-spring-web-2.9.0.jar:2.9.0]
at com.google.common.collect.Iterators$7.transform(Iterators.java:750) ~[guava-20.0.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47) ~[guava-20.0.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47) ~[guava-20.0.jar:na]
at com.google.common.collect.MultitransformedIterator.hasNext(MultitransformedIterator.java:52) ~[guava-20.0.jar:na]
at com.google.common.collect.MultitransformedIterator.hasNext(MultitransformedIterator.java:50) ~[guava-20.0.jar:na]
at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:408) ~[guava-20.0.jar:na]
at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:699) ~[guava-20.0.jar:na]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:256) ~[guava-20.0.jar:na]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:209) ~[guava-20.0.jar:na]
at com.google.common.collect.FluentIterable.toList(FluentIterable.java:614) ~[guava-20.0.jar:na]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.defaultContextBuilder(DocumentationPluginsBootstrapper.java:109) ~[springfox-spring-web-2.9.0.jar:2.9.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.buildContext(DocumentationPluginsBootstrapper.java:96) ~[springfox-spring-web-2.9.0.jar:2.9.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:167) ~[springfox-spring-web-2.9.0.jar:2.9.0]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
... 19 common frames omitted
The method is
public Optional<RepositoryInformation> getRepositoryInformationFor(Class<?> domainClass)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Error Handling for REST with Spring - Baeldung
This tutorial will illustrate how to implement Exception Handling with Spring for a REST API. We'll also get a bit of historical overview ......
Read more >Spring Data Rest exception handling - Return generic error ...
I want to know how can I handle internal server error type exceptions in Spring Data Rest such as JPA exceptions etc. due...
Read more >Guide to Spring Boot REST API Error Handling - Toptal
Let's explore some Spring annotations used to handle exceptions. RestController is the base annotation for classes that handle REST operations. ExceptionHandler ...
Read more >Spring Data REST Reference Guide
Spring Data REST exposes a collection resource named after the uncapitalized, pluralized version of the domain class the exported repository is ...
Read more >Exception Handling in Spring Boot REST API
There are several techniques for exception handling with Spring Boot REST APIs. You can learn about each of them in this blog post....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dilipkrish that’s not correct. I believe that the original poster had a typo and meant SDR 3 not 2. So this is occurring on version >= boot 2.0 not before
I’m using spring boot
2.0.2.RELEASE
, which includes Spring Data Rest3.0.6.RELEASE
which is the latest version and have this issue.Don’t tell mr “hypermedia uber alles” gierke, but i was looking for a quick and dirty example and i simply took https://github.com/olivergierke/spring-restbucks and added in springfox, and it fails.
You can check out: https://github.com/madorb/spring-restbucks
and see failure by running
mvn package
I still have this problem when using Spring Boot 2.1.9.RELEASE with spring-boot-starter-data-rest and springfox 2.9.2 - looks like springfox 2.9.2 is still bound to spring-data-commons 1.x instead of 2.x. Also I have to exclude com.google.guava guava artefact, because it’s to old for my other dependencies … Would be nice to have a 2.10.x release with actual dependencies.