java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer
?? ?at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:184) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?? ?at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.12.RELEASE.jar:2.2.12.RELEASE]
?? ?at com.lxyk.yygh.ServiceGatewayApplication.main(ServiceGatewayApplication.java:11) [classes/:na]
Caused by: java.lang.IllegalStateException: Failed to introspect Class [springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
?? ?at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
?
報(bào)錯代碼如上:
微服務(wù)架構(gòu)
?文章來源地址http://www.zghlxwxcb.cn/news/detail-760493.html
gateway和swagger沖突:
注意:我這里service-gateway并沒有使用swagger,而是使用工具類工程導(dǎo)入時(shí)帶入
如果想看gateway整合swagger,可跳過文章
。。之前本來沒有報(bào)錯,隔天啟動就報(bào)錯。。。一天多了才解決,各種方案均試過,然后又會出各種報(bào)錯,bug制造機(jī)
gateway和以下的包都沖突:
所以如果導(dǎo)入了web的jar包,需要注釋掉
gateway使用的是webflux,和web會造成沖突
????????<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <scope>provided</scope> </dependency>
網(wǎng)關(guān)和@EnableSwagger2會沖突,如果你去掉這個注解就不會報(bào)錯,但是,會導(dǎo)致其他模塊引入的swagger測試失效:
?
?解決方案:
查看網(wǎng)關(guān)的maven依賴樹
,查找swagger出現(xiàn)的依賴工程 ,我這里已經(jīng)去掉了該工程
?文章來源:http://www.zghlxwxcb.cn/news/detail-760493.html
去掉有swagger依賴的工程,但是不明白為什么之前沒報(bào)錯,突然就報(bào)錯了,跟著視頻里面的老師寫的,是這樣寫的也沒報(bào)錯?
明明主啟動類沒有使用@ComponentScan來掃描swagger的包,但是swagger卻生效
待研究,,
?
?
?
?
到了這里,關(guān)于Caused by: java.lang.IllegalStateException: Failed to introspect Class [springfox.documentation.swag的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!