异常信息1
2022-01-02 20:03:33,821 ERROR LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 2 of constructor in com.rus.service.impl.MoveServiceImpl required a bean of type 'com.rus.entity.MoveRntity' that could not be found.
Action:
Consider defining a bean of type 'com.rus.entity.MoveRntity' in your configuration.
解决方案
entity中确实无参构造方法
异常信息2
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in \com.rus.service.impl.MoveServiceImpl 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.
解决方案
由于MoveServiceImpl是一个共同的基类
不能添加@service注解
本文探讨了两个Spring Boot应用启动时遇到的问题:一是MoveServiceImpl缺少`MoveRntity`类型的参数,二是`MoveServiceImpl`构造函数需要`String`类型参数。提供了解决方案,包括检查配置是否定义了所需实体bean和明确指定String类型bean。
6529

被折叠的 条评论
为什么被折叠?



