我在Spring Boot 2项目中添加了Springfox Swagger2 2.8.0,在启动应用程序时遇到了以下问题:
com.google.common.util.concurrent.ExecutionError: java.lang.StackOverflowError
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216) ~[guava-23.0.jar:na]
at com.google.common.cache.LocalCache.get(LocalCache.java:4147) ~[guava-23.0.jar:na]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) ~[guava-23.0.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) ~[guava-23.0.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146) ~[guava-23.0.jar:na]
at springfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:57) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:70) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:90) [springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:71) [springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.scanDocumentation(DocumentationPluginsBootstrapper.java:96) [springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:158) [springfox-spring-web-2.8.0.jar:2.8.0]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:183) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:52) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:358) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:159) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:884) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:122) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M6.jar:2.0.0.M6]
at com.decisionwanted.api.Application.main(Application.java:40) [classes/:na]
Caused by: java.lang.StackOverflowError: null
at java.util.Currency.getInstance(Currency.java:318) ~[na:1.8.0_152]
at java.util.Currency.getInstance(Currency.java:399) ~[na:1.8.0_152]
at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:638) ~[na:1.8.0_152]
at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:113) ~[na:1.8.0_152]
at sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85) ~[na:1.8.0_152]
at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180) ~[na:1.8.0_152]
at java.util.Formatter.getZero(Formatter.java:2283) ~[na:1.8.0_152]
at java.util.Formatter.<init>(Formatter.java:1892) ~[na:1.8.0_152]
at java.util.Formatter.<init>(Formatter.java:1914) ~[na:1.8.0_152]
at java.lang.String.format(String.java:2940) ~[na:1.8.0_152]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.nestedParentName(ModelAttributeParameterExpander.java:259) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:97) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:114) ~[springfox-spring-web-2.8.0.jar:2.8.0]
这个问题可能是什么原因以及如何解决?
答案 0 :(得分:2)
请将您的摇摇欲坠的版本升级到v2.9.2
它为我工作,并解决了这个问题。
您将在此处找到更多信息,
java.lang.StackOverflowError#2232 https://github.com/springfox/springfox/issues/2232