bug记录
在启动springboot项目时候,抛出启动异常,
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/advertise]]
后面才发现是定时任务异常。
Caused by: java.lang.IllegalStateException: Encountered invalid @Scheduled method 'user':
Cron expression must consist of 6 fields (found 7 in "0 0 2 * * ? *")
在线生成cron表达式: https://cron.qqe2.com/.
在线生成的表达式是7位的,末尾包含了年份的概念,而springboot这里用注解只能是6位表达式
把最后的一个星号去掉就可以正常启动了。
有知道为什么的大神请赐教