Encountered invalid @Scheduled method 'test1': Only no-arg methods may be annotated with @Scheduled

springBoot 项目中,使用定时任务报错

 

springBoot 项目中,使用定时任务报错

解决:

出现这个错误主要是@Scheduled注解下的方法带有参数,把@Scheduled注解下的方法的参数去掉就可以了

相关文章: