@Scheduled annotation fixedDelayString attribute does not resolve SpEL expressions [SPR-14114] #18686
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
Sean Stephenson opened SPR-14114 and commented
I have a
@Scheduled
method that should execute every N seconds, where N is an interval specified in a config file. Here is how my declaration looks.@Scheduled
(fixedDelayString = "#{${myapp.intervalInSeconds} * 1000}")public void run() {
// ...
}
Unfortunately, while specifying a property replace expression like "${myapp.intervalInSeconds}" works correctly, using a SpEL expression to convert this to milliseconds does not work. I get the following error message on attempting to start Spring.
Caused by: java.lang.IllegalStateException: Encountered invalid
@Scheduled
method 'run': Invalid fixedDelayString value "#{10 * 1000}" - cannot parse into integerAffects: 4.1.7
Issue Links:
@Scheduled
) ("duplicates")The text was updated successfully, but these errors were encountered: