问题描述:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2024-05-10 15:50:15.756 | ERROR 9120 | main [TID: N/A] o.s.b.d.LoggingFailureAnalysisReporter | *************************** APPLICATION FAILED TO START *************************** Description: Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'energy.error-code' to com.citecanvas.energy.framework.errorcode.config.ErrorCodeProperties failed: Property: energy.error-code.constantsClassList Value: "null" Reason: 错误码枚举类不能为空 Action: Update your application's configuration
问题原因:
这表明在启动应用程序上下文时出错。具体描述为在将'energy.error-code'
相关属性绑定到指定对象时出现异常,原因是constantsClassList
属性值为"null"
,提示错误码枚举类不能为空。
解决办法:
解决办法就是按照提示去更新应用程序的配置,确保energy.error-code.constantsClassList
被正确设置且不为空。你需要检查相关配置文件或代码中对该属性的设置情况。
error-code: # 错误码相关配置项
constants-class-list:
- com.citecanvas.energy.module.infra.enums.ErrorCodeConstants