springfox: springfox doesn't work with spring boot 2.0 and spring data Kay-RC2
- What version of the library are you using I am using latest released version: 2.7.0
What kind of issue is this?
- Feature Request:- Springfox support for spring-data-rest covered inside spring data KAY-RC2
When I am using Springfox with Spring-boot 2.0.0.M3 and Spring Data release train KAY-RC2, it is showing me the error like below:
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.7.0.jar:2.7.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper$2.apply(DocumentationPluginsBootstrapper.java:129) ~[springfox-spring-web-2.7.0.jar:2.7.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper$2.apply(DocumentationPluginsBootstrapper.java:126) ~[springfox-spring-web-2.7.0.jar:2.7.0]
at com.google.common.collect.Iterators$8.transform(Iterators.java:799) ~[guava-18.0.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-18.0.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-18.0.jar:na]
at com.google.common.collect.Iterators$5.hasNext(Iterators.java:548) ~[guava-18.0.jar:na]
at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:300) ~[guava-18.0.jar:na]
at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:691) ~[guava-18.0.jar:na]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:275) ~[guava-18.0.jar:na]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226) ~[guava-18.0.jar:na]
at com.google.common.collect.FluentIterable.toList(FluentIterable.java:373) ~[guava-18.0.jar:na]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.defaultContextBuilder(DocumentationPluginsBootstrapper.java:100) ~[springfox-spring-web-2.7.0.jar:2.7.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.buildContext(DocumentationPluginsBootstrapper.java:91) ~[springfox-spring-web-2.7.0.jar:2.7.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:154) ~[springfox-spring-web-2.7.0.jar:2.7.0]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:183) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
Thanks.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 15 (4 by maintainers)
Commits related to this issue
- Merge branch 'iles-2e-feature/spring5' fixes #1773 fixes #1957 — committed to springfox/springfox by dilipkrish 6 years ago
This issue happens that line. https://github.com/springfox/springfox/blob/75f9c2d73e7707cf586c62ecbfc6746d75b8b21a/springfox-data-rest/src/main/java/springfox/documentation/spring/data/rest/EntityServicesProvider.java#L81
springfox-data-rest expects org.springframework.data.repository.support.Repositories.getRepositoryInformationFor returns RepositoryInformation. However, org.springframework.data.repository.support.Repositories.getRepositoryInformationFor returns Optional<RepositoryInformation>.
It was changed this commit. https://github.com/spring-projects/spring-data-commons/commit/d4811e29d9a95b97dc4ee219ae2de46be93049bb#diff-7e6bda0dafd0b570cee39ae62b153209L189
And now, there is new getRequiredRepositoryInformation method that returns RepositoryInformation. https://github.com/spring-projects/spring-data-commons/commit/c84e6c84277cf4c70696ec474c5edcc317dcf081#diff-7e6bda0dafd0b570cee39ae62b153209R200
I don’t know the best way to support both spring-data-rest version. But it should be changed.
Any plans to release a hotfix?
Same problem with spring boot 2.1.0 or 2.0.5 and springfox/swagger 2.9.2
I have got the same problem here with spring boot 2.0.0.M5 and springfox 2.7.0
@mrkk Would you mind trying the latest SNAPSHOT? Its been fixed but not yet released
has been a year, is anyone fixing this please?
Confirmed with spring boot 2.0.0.M3 and springfox 2.7.0 as well.
Hello,
I have the same problem with Spring Boot 2.0.0.BUILD-SNAPSHOT.
Is this something that can be fixed soon ?
Thanks!