Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to run cron jobs dynamically.

Instead of putting a direct @Scheduled annotation like @Scheduled(cron = "0 0/30 3 * * *") on the main function, I want to take cron expression in input and then schedule job according to the input given.

I have tried to use CronExpression, But it's not giving correct results. Even for cronExpression = "0 0/30 1 * * *", It's returning that cron expression is not valid.

Error that I am getting while using cronExpression is

Exception in thread "main" java.text.ParseException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.

Is there any way to do this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
454 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...