Results 1 to 2 of 2

Thread: scheduled annotation with cron expression

  1. #1
    Join Date
    Feb 2012
    Posts
    101

    Default scheduled annotation with cron expression

    Hi,

    I tried using @scheduled(cron = "${config.Time}") on the method which should execute at some time.I have defined the cron expression in the properties file as config.time="0 0 1 * * *".

    But I see this exception ,am I missing something here.

    20:56:48,418 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-13) Context initialization failed: java.lang.NumberFormatException: For input string: ""0"
    at java.lang.NumberFormatException.forInputString(Num berFormatException.java:65) [rt.jar:1.7.0_03]
    at java.lang.Integer.parseInt(Integer.java:481) [rt.jar:1.7.0_03]
    at java.lang.Integer.valueOf(Integer.java:582) [rt.jar:1.7.0_03]
    at org.springframework.scheduling.support.CronSequenc eGenerator.getRange(CronSequenceGenerator.java:324 ) [spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

    Please help.
    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Try removing the quotes from the value in your properties file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •