Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'holidayScheduleController' defined in file [E:\workspace\clone\oumengehr\target\oumeng-1.0\WEB-INF\classes\com\oumeng\controller\holiday\HolidayScheduleController.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method 'initCalendar': Cron expression must consist of 6 fields (found 7 in "0 0 3 1 9 ? *")
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.ge
@Scheduled定时任务报BeanCreationException
最新推荐文章于 2023-11-09 18:42:51 发布
在使用Spring Boot的@Scheduled注解创建定时任务时,如果注解的方法带有参数,会导致BeanCreationException。请确保定时任务方法无参,以避免此类错误。
摘要由CSDN通过智能技术生成