[急]gateway引入xxx-xxx-api启动报错

Blade 已结 1 910
wx102304
wx102304 剑圣 2020-06-08 13:42
悬赏:5

一、该问题的重现步骤是什么?

1. 想在gateway使用feign调用其他服务

2. gateway使用的webflux 但是引入其他服务会自动注入web的相关内容  不引入xxx-xxx-api不会报错

3.


二、你期待的结果是什么?实际看到的又是什么?

在gateway正常调用feign  引入api包启动不报错


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

2.5baldex    windows10

四、请提供详细的错误堆栈信息,这很重要。

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springblade.gateway.GateWayApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurer.class] cannot be opened because it does not exist

at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:596) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.access$900(ConfigurationClassParser.java:108) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:801) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_121]

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:798) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:770) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49) [blade-core-launch-2.5.0.RELEASE.jar:na]

at org.springblade.gateway.GateWayApplication.main(GateWayApplication.java:37) [classes/:na]

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurer.class] cannot be opened because it does not exist

at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[spring-core-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51) ~[spring-core-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73) ~[spring-boot-2.1.13.RELEASE.jar:2.1.13.RELEASE]

at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[spring-core-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:682) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getInterfaces(ConfigurationClassParser.java:1002) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.processInterfaces(ConfigurationClassParser.java:375) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:323) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:586) ~[spring-context-5.1.14.RELEASE.jar:5.1.14.RELEASE]

... 19 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:56819', transport: 'socket'

五、若有更多详细信息,请在下面提供。

1条回答
  •  zhx1994
    zhx1994 (最佳回答者)
    2020-06-08 17:39

    https://sns.bladex.cn/q-1583.html

    作者追问:2020-06-08 17:39

    这个没啥用啊 我之前看过  我就想问下bladex是不是不推荐在gateway'调用feign、因为真的好多包依赖都冲突  我一下午好不容易把冲突的都找出来先干掉了 结果@EnableBladeFeign 这个注解 启动网关都有冲突  我真的崩溃  不推荐用说一下   我就换别的方式了。

    2 讨论(1)
提交回复