Windows11上idea2021.2.2启动Gateway报错

Blade 已结 1 657
coder
coder 剑童 2021-11-29 11:01


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

期待正确启动,实际报错


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

BLADEX 2.8.2.RELEASE,Windows11

IntelliJ IDEA 2021.2.2 (Ultimate Edition)

JDK1.8.0_311


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

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-11-29 10:37:30.437 ERROR 5552 --- [           main] o.s.boot.SpringApplication               : Application run failed


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:610) ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]

at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:111) ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]

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

at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_311]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50) [classes/:na]

at org.springblade.gateway.GateWayApplication.main(GateWayApplication.java:36) [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:187) ~[spring-core-5.2.15.RELEASE.jar:5.2.15.RELEASE]

at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[spring-core-5.2.15.RELEASE.jar:5.2.15.RELEASE]

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

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

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

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

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

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

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

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

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

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

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

... 20 common frames omitted


2021-11-29 10:37:30.441  WARN 5552 --- [      Thread-14] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Start destroying Publisher

2021-11-29 10:37:30.441  WARN 5552 --- [      Thread-14] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Destruction of the end

2021-11-29 10:37:30.441  WARN 5552 --- [       Thread-5] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Start destroying common HttpClient

2021-11-29 10:37:30.443  WARN 5552 --- [       Thread-5] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Destruction of the end

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


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

最开始不报错,这个项目因为有git仓库 所以我也能看到是否有修改,确实没有修改项目框架的内容

然后某次重启出现这个问题,然后把maven的repository都删除,项目重新拉取启动还是有这个错误

1条回答
  •  coder
    coder (最佳回答者)
    2021-11-29 16:11

    艹,我竟然自己解决了

    哎, 那个过程不想提了

    同事写的代码间接造成的报错,我是从每天的提交切出一个分支,然后定位到问题


    最后也算是给大家一个忠告:

    不要在blade-common里面使用跟spring的注入有关的注解

    需要实例bean一定要放在自己的业务代码中

    回答: 2021-11-29 16:11

    我不能采纳自己的回答,也不能标记已结,还没有人回复

    回答: 2021-11-29 16:11

    我不能采纳自己的回答,也不能标记已结,还没有人回复

    1 讨论(1)
提交回复