项目场景:
Parameter 3 of constructor in cn.xxx required a bean of type 'java.lang.String' that could not be found
问题描述:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-11-10 11:24:32.661   {faint}  ERROR 21720 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ***************************
APPLICATION FAILED TO START
***************************Description:Parameter 1 of constructor in cn.xxx required a bean of type 'java.lang.String' that could not be found.Action:Consider defining a bean of type 'java.lang.String' in your configuration.Process finished with exit code 1原因分析:
@AllArgsConstructor 与 @Value 不能同时用
解决方案:
把 @AllArgsConstructor 换成 @RequiredArgsConstructor
作者:筱白爱学习!!
欢迎关注转发评论点赞沟通,您的支持是筱白的动力!