prod环境报OpenApiExtensionResolver' that could not be found.

Blade 未结 1 92
dcjt
dcjt 剑圣 2025-05-28 11:46

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

1. application.yml

:
  : :
    : : blade
    : blade
  :
    : : : : http://localhost
    : : : POST
    : : : : Copyright © 2021 BladeX All Rights Reserved

:
  : : : 2.8.0.RELEASE
  : Powered By DCJT
  :
  :
  :
    : samllchill
    : samllchill@163.com
    : https://gitee.com/smallc


dev、test环境不报错,prod环境启动报如下错误

11:39:36.777 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 


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

APPLICATION FAILED TO START

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


Description:


Parameter 1 of constructor in org.springblade.common.config.SwaggerConfiguration required a bean of type 'com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver' that could not be found.



Action:


Consider defining a bean of type 'com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver' in your configuration.


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


Process finished with exit code 1


1条回答
  • 2025-05-28 18:09

    检查nacos的blade.yaml,把knife4j.enable,swagger.enabled配置改成false

    作者追问:2025-05-30 10:56

    没使用nacos,我把生产环境改成knife4j.enable=false也不行

    回答: 2025-06-06 13:40

    你到common包里的LauncherServiceImpl里加上这两个配置,强制改成false看看

    CleanShot20250606133943@2x.png

    0 讨论(0)
代码语言
提交回复