Spring Scheduled定时任务报错 java.lang.IllegalStateException: Encountered invalid @Scheduled method 'xxx': For input string: "2S"
报错信息如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dingTalkMessagePump' defined in file [F:\workspace\NEWSRC\WebContent\WEB-INF\classes\artifacts\ERP_Web_exploded\WEB-INF\classes\com\xxx\softprojectmanage\utils\DingTalkMessagePump.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method 'gzyqtjList': For input string: "2S"
错误代码
/***
* 每周2-6早上上班前(08:00)统计任务有延期的员工,并发送通知
*/
@Scheduled(cron = "0 0 8 ? * TUES-SAT")
public void gzyqtjList() {
正确代码
/***
* 每周2-6早上上班前(08:00)统计任务有延期的员工,并发送通知
*/
@Scheduled(cron = "0 0 8 ? * TUE-SAT")
public void gzyqtjList() {
周二用TUE而不是TUES
Spring Scheduled定时任务报错 java.lang.IllegalStateException: Encountered invalid @Scheduled method 'xxx': For input string: "2S"的更多相关文章
- Spring Boot单元测试报错java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]
1 报错描述 java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @Boot ...
- 云笔记项目- 上传文件报错"java.lang.IllegalStateException: File has been moved - cannot be read again"
在做文件上传时,当写入上传的文件到文件时,会报错“java.lang.IllegalStateException: File has been moved - cannot be read again ...
- eclipse启动报错java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' befo
报错: java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invo ...
- 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level
解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...
- springboot测试启动报错java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
springboot测试启动报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne ...
- spring mvc处理http请求报错:java.lang.IllegalStateException: getInputStream() has already been called for this request
发送post请求到controller处理失败,报错日志如下: java.lang.IllegalStateException: getInputStream() has already been c ...
- springboot 启动报错 java.lang.IllegalStateException: Failed to introspect annotated methods on class org
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ...
- spring低版本报错:java.lang.IllegalStateException: Context namespace element ‘annotation-config’ and its parser class [*] are only available on
参考来源:http://blog.csdn.net/sunxiaoyu94/article/details/50492083 使用spring低版本(2.5.6),使用jre 8发现错误: Unexp ...
- Idea 的Test测试报错:java.lang.IllegalStateException: Failed to load ApplicationContext
因为在Test里面使用了注解@Autowired 引入来至bean.xml文件的内容 ,而在Test没有没有办法自动引入,需要在Test类上加上注解 @ContextConfiguration(loc ...
随机推荐
- 第十二章 Java内存模型与线程
Java内存模型(Java Memory Model,JMM): 主内存与工作内存:Java内存模型主要是定义程序中各个变量的访问规则.Java内存模型规定了所有的变量都存储在主内存(Main Mem ...
- pip升级
只要出现报错:python -m pip install --upgrade pip.都表示需要进行升级pip版本 查看pip版本:pip -V(pip可能是python2版本或python3版本) ...
- MapReduce时mapping内存不足
17/11/07 16:53:50 INFO mapreduce.Job: Job job_1510042506570_0007 failed with state KILLED due to: MA ...
- Win10 安装SqlServer2012 无法访问数据库
win10系统,安装好vs2017,sqlserver2012, 在abp 执行 Update-Database 会出错 具体解决办法是SqlServer2012的1433端口没打开. 打开办 ...
- python大法好——多线程
Python 多线程 多线程类似于同时执行多个不同程序,多线程运行有如下优点: 使用线程可以把占据长时间的程序中的任务放到后台去处理. 用户界面可以更加吸引人,这样比如用户点击了一个按钮去触发某些事件 ...
- centos7,zabbix3.2通过zabbix_java_gateway监控jmx[java/tomcat]
网络上很多教程也比较多和全了,但是自己做时候多多少少的坑备注下吧. 1,监控原理简单说一下,就是zabbix_server通过代理(zabbix_java_gateway)来获取agent端(tomc ...
- ThreeJs 绘制点、线、面
所有的三位物体都是由点构成,两点构成线,三点构成面,ThreeJs又如何绘制出点.线.面呢 ? 在ThreeJs中: 模型由几何体和材质构成 模型以何种形式(点.线.面)展示取决于渲染方式 1. 几何 ...
- Django ORM中常用字段和参数
一些说明: 表myapp_person的名称是自动生成的,如果你要自定义表名,需要在model的Meta类中指定 db_table 参数,强烈建议使用小写表名,特别是使用MySQL作为后端数据库时. ...
- oracle数据库用户删除及表空间删除
以system用户登录,查找需要删除的用户: --查找用户 select * from dba_users; --查找工作空间的路径select * from dba_data_files; --删 ...
- Java中获取系统时间的四种方式
第一种: Date day=new Date(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" ...