[日常记录]—SpringBoot启动无法代理创建Bean
错误信息如下
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in com.jon.demo.utils.GenerateMaxId required a bean of type 'java.lang.Long' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'java.lang.Long' in your configuration.
原因:
1、工具类中缺少了@Component
2、工具类中自定义了有参构造,但是没有显式声明无参构造器