Encountered invalid @Scheduled method ‘getPlanBoardStatistics‘: Only no-arg methods may be annotated

本文阅读 1 分钟
首页 代码,Java 正文

        记录一下今天写代码时出现的bug <font size="3">        Caused by: java.lang.IllegalStateException: Encountered invalid @Scheduled method ‘getPlanBoardStatistics’: Only no-arg methods may be annotated with @Scheduled at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.processScheduled(ScheduledAnnotationBeanPostProcessor.java:496) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE] at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.lambda$null$1(ScheduledAnnotationBeanPostProcessor.java:359) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_181] </font> img

        使用spring的@Scheduled()注解时候,报了这个错误,报错原因是@Scheduled()注解不能使用在带参数的方法中。         注意:使用@Scheduled()注解的时候,要记得在启动类上使用@EnableScheduling注解开启定时器。

本文为互联网自动采集或经作者授权后发布,本文观点不代表立场,若侵权下架请联系我们删帖处理!文章出自:https://blog.csdn.net/qq_46540738/article/details/124138373
-- 展开阅读全文 --
安全面试之XSS(跨站脚本攻击)
« 上一篇 07-24

发表评论

成为第一个评论的人

热门文章

标签TAG

最近回复