org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySchulderManager' defined in file [D:\six-p2p\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\timer\WEB-INF\classes\com\bjpowernode\p2p\timer\MySchulderManager.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method 'test': Cron expression must consist of 6 fields (found 7 in "0/3 * * * * * *")
原因是cron表达式里面多写了一个*
纪念马虎的自己
本文记录了一次因cron表达式错误导致的Spring定时任务初始化失败的问题。具体错误为cron表达式中多输入了一个'*'字符,导致字段数量超出标准的6个字段限制。通过修正cron表达式,成功解决了BeanCreationException异常。
5590

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



