在正式环境启动knife4j报错

Blade 已结 2 80
154879594
154879594 2024-11-11 17:32

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

1. 在正式环境启动

2. 

3.


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

能成功启动服务


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


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

INFO: Sentinel log level is: INFO

2024-11-11 17:00:08.554  WARN 16843 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'knife4jOpenApiCustomizer' defined in class path resource [com/github/xiaoymin/knife4j/spring/configuration/Knife4jAutoConfiguration.class]: Unsatisfied dependency expressed through method 'knife4jOpenApiCustomizer' parameter 0: No qualifying bean of type 'org.springdoc.core.properties.SpringDocConfigProperties' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

2024-11-11 17:00:08.558  INFO 16843 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...

2024-11-11 17:00:08.580  INFO 16843 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed

2024-11-11 17:00:08.581  WARN 16843 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent


org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'meterRegistryCloser': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)

at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:265)

at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:222)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:457)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)

at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1130)

at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1093)

at org.springframework.cloud.context.named.NamedContextFactory.destroy(NamedContextFactory.java:114)

at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1202)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1195)

at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1186)

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

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)

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

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

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

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

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

at org.springblade.desk.DeskApplication.main(DeskApplication.java:41)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

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

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

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


2024-11-11 17:00:08.594  WARN 16843 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent


org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'meterRegistryCloser': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)

at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:265)

at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:222)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:457)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)

at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1130)

at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1093)

at org.springframework.cloud.context.named.NamedContextFactory.destroy(NamedContextFactory.java:114)

at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1202)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1195)

at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1186)

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

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)

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

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

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

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

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

at org.springblade.desk.DeskApplication.main(DeskApplication.java:41)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

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

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

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


2024-11-11 17:00:08.737  INFO 16843 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 


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

2024-11-11 17:00:08.846 ERROR 16843 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************

APPLICATION FAILED TO START

***************************


Description:


Parameter 0 of method knife4jOpenApiCustomizer in com.github.xiaoymin.knife4j.spring.configuration.Knife4jAutoConfiguration required a bean of type 'org.springdoc.core.properties.SpringDocConfigProperties' that could not be found.



Action:


Consider defining a bean of type 'org.springdoc.core.properties.SpringDocConfigProperties' in your configuration.


五、若有更多详细信息,请在下面提供。
全部服务都报了这个错

2条回答
  •  admin
    admin (楼主)
    2024-11-11 17:48

    启动用的是dev还是prod环境,是本地启动的还是服务器启动的,本地启动的时候是否成功

    作者追问:2024-11-11 17:48

    启动用的prod环境,是在服务器上启动报的错。在本地是可以成功启动的

    回答: 2024-11-11 17:48

    你在本地用prod是否能成功?

    如果本地prod能成功的话,你在服务器启动dev模式看看能不能成功。如果服务器dev成功,继续把dev的配置文件覆盖到prod文件再用prod模式启动看看能不能成功。

    作者追问:2024-11-11 17:48

    在本地启动DEV模式成功,然后启动prod起不来,把全部模块的application.yml dev和prod的都一样了,blade.yml也是。
    在服务器上启动的了dev模式,prod也是起不来

提交回复