blade-gateway模块报错

Blade 未结 2 389
rdbook
rdbook 剑童 2023-09-09 09:27

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

   1. blade-gate模块启动不了

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


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

    springblade开源版本

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

image.png

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

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

2023-09-09 09:18:16.087 ERROR 7200 --- [           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:609) ~[spring-context-5.3.27.jar:5.3.27]

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

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

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

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

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

at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:192) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:748) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.27.jar:5.3.27]

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

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.10.jar:2.7.10]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.10.jar:2.7.10]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.10.jar:2.7.10]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164) [spring-boot-2.7.10.jar:2.7.10]

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

at org.springblade.gateway.GateWayApplication.main(GateWayApplication.java:33) [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:199) ~[spring-core-5.3.27.jar:5.3.27]

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

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

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

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

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

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

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

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

at org.springframework.context.annotation.ConfigurationClassParser.processInterfaces(ConfigurationClassParser.java:385) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:331) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249) ~[spring-context-5.3.27.jar:5.3.27]

at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599) ~[spring-context-5.3.27.jar:5.3.27]

... 19 common frames omitted


2条回答
  • 2023-09-11 13:00

    检查一下Gateway引入的依赖,不能包含spring-web,因为Gateway基于webflux,会和web冲突

    0 讨论(0)
  • 2023-09-11 14:56

    依赖已经过滤掉了image.png,还是 不行,泪奔,前天还可以


    回答: 2023-09-11 14:58

    <>
        <>
            <>SpringBlade</>
            <>org.springblade</>
            <>3.6.0</>
        </>
        <>4.0.0</>
    
        <>blade-gateway</>
        <>${project.artifactId}</>
        <>${blade.project.version}</>
        <>jar</>
    
        <>
            <>
                <>org.springblade</>
                <>blade-core-launch</>
                <>${blade.tool.version}</>
                <>
                    <>
                        <>org.springframework.boot</>
                        <>spring-boot-starter-web</>
                    </>
                    <>
                        <>org.springframework.boot</>
                        <>spring-boot-starter-undertow</>
                    </>
                </>
            </>
            <>
                <>org.springblade</>
                <>blade-common</>
                <>${blade.project.version}</>
                <>
                    <>
                        <>org.springblade</>
                        <>blade-core-launch</>
                    </>
                </>
            </>
            <>
                <>org.springframework.cloud</>
                <>spring-cloud-starter-gateway</>
            </>
            <>
                <>org.springframework.boot</>
                <>spring-boot-starter-data-redis-reactive</>
            </>
            <>
                <>de.codecentric</>
                <>spring-boot-admin-starter-client</>
                <>${spring.boot.admin.version}</>
            </>
            <>
                <>org.springframework.cloud</>
                <>spring-cloud-starter-loadbalancer</>
            </>
            <>
                <>org.springframework.cloud</>
                <>spring-cloud-starter-bootstrap</>
            </>
            <>
                <>com.alibaba.cloud</>
                <>spring-cloud-starter-alibaba-sentinel</>
            </>
            <>
                <>io.jsonwebtoken</>
                <>jjwt-impl</>
                <>0.11.2</>
            </>
            <>
                <>io.jsonwebtoken</>
                <>jjwt-jackson</>
                <>0.11.2</>
            </>
        </>
    
        <>
            <>
                <>
                    <>com.spotify</>
                    <>docker-maven-plugin</>
                    <>${docker.plugin.version}</>
                    <>
                        <>${docker.registry.url}/blade/${project.artifactId}:${project.version}</>
                        <>${project.basedir}</>
                        <>${docker.registry.host}</>
                        <>
                            <>
                                <>/</>
                                <>${project.build.directory}</>
                                <>${project.build.finalName}.jar</>
                            </>
                        </>
                        <>${docker.registry.url}</>
                        <>${docker.registry.url}</>
                        <>true</>
                    </>
                </>
                <>
                    <>org.apache.maven.plugins</>
                    <>maven-antrun-plugin</>
                    <>1.3</>
                    <>
                        <>
                            <>package</>
                            <>
                                <>run</>
                            </>
                            <>
                                <>
                                    </>
                                </>
                            </>
                        </>
                    </>
                </>
            </>
        </>
    
    </>



    0 讨论(0)
提交回复