gateway网关 运行报错

Blade 未结 2 1536
zhangyijun
zhangyijun 剑童 2020-07-28 19:59

gateway网关 运行报错:

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)

at org.springframework.context.annotation.ConfigurationClassParser.access$900(ConfigurationClassParser.java:108)

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:801)

at java.util.ArrayList.forEach(ArrayList.java:1257)

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:798)

at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:770)

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185)

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)

at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49)

at org.springblade.gateway.GateWayApplication.main(GateWayApplication.java:36)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)

at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)

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)

at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51)

at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)

at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86)

at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73)

at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81)

at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:682)

at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getInterfaces(ConfigurationClassParser.java:1002)

at org.springframework.context.annotation.ConfigurationClassParser.processInterfaces(ConfigurationClassParser.java:375)

at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:323)

at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)

at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:586)

... 27 common frames omitted


2条回答
  • 查一下依赖,是否依赖了spring-web模块,因为Gateway是webflux,会与springweb冲突。把依赖去掉就可以启动成功了

    0 讨论(0)
  • 2020-07-29 09:27

    好的,我试试。 谢谢可以了。

    0 讨论(0)
提交回复