quarkusio/quarkus · error · IllegalArgumentException
Invalid '<paramName>String' value "<value>" - cannot parse i
Error message
Invalid '<paramName>String' value "<value>" - cannot parse into long
What it means
A *String attribute of Spring's @Scheduled (e.g. fixedRateString) must resolve to text parseable as a long after optional property-placeholder lookup. The processor parses it at build time with Long.valueOf and throws when the value is not a plain number.
Source
Thrown at extensions/spring-scheduled/deployment/src/main/java/io/quarkus/spring/scheduled/deployment/SpringScheduledProcessor.java:173
} else { //param value as String e.g. a placeholder ${value.from.conf} or java.time.Duration compliant value
paramValueString = getAnnotationValueByName(springAnnotationValues, paramName + "String")
.get().asString();
paramValue = valueOf(paramName, paramValueString);
}
return paramValue;
}
private long valueOf(String paramName, String paramValueString) {
long paramValue;
if (paramValueString.startsWith("${")) {
paramValueString = paramValueString.replace("${", "{").trim();
paramValueString = SchedulerUtils.lookUpPropertyValue(paramValueString);
}
try {
paramValue = Long.valueOf(paramValueString);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(
"Invalid '" + paramName + "String' value \"" + paramValueString + "\" - cannot parse into long");
}
return paramValue;
}
private boolean annotationsValuesContain(List<AnnotationValue> springAnnotationValues, String valueName) {
return springAnnotationValues.stream().filter(spv -> spv.name().equals(valueName)).findAny().isPresent();
}
private Optional<AnnotationValue> getAnnotationValueByName(List<AnnotationValue> springAnnotationValues, String valueName) {
return springAnnotationValues.stream().filter(spv -> spv.name().equals(valueName)).findAny();
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Set the referenced property to a plain numeric value (e.g. my.rate=5000) in application.properties
- Replace the *String attribute with a numeric literal (fixedRate = 5000)
- Convert the value to milliseconds and remove unit suffixes
- Verify the placeholder can be resolved at build time (avoid runtime-only config sources)
Example fix
// before
@Scheduled(fixedRateString = "${job.rate}") // job.rate not set
void run() {}
// after (application.properties: job.rate=5000)
@Scheduled(fixedRateString = "${job.rate}")
void run() {} Defensive patterns
Strategy: validation
Validate before calling
String raw = "${job.rate}";
String resolved = resolveProperty(raw); // from application.properties
try {
Long.parseLong(resolved);
} catch (NumberFormatException e) {
throw new IllegalStateException("@Scheduled *String value must be a long: " + resolved);
} Prevention
- Ensure every ${...} property referenced by *String attributes is set to a plain number
- Avoid time-unit strings like '5s' in these attributes
- Add a build-time test that parses all referenced schedule properties
When it happens
Trigger: @Scheduled(fixedRateString = "abc") or fixedRateString = "${my.rate}" where the property is missing (placeholder fails to resolve) or its value is not a plain long (e.g. "5s", "PT5S").
Common situations: Config property not set in application.properties so the placeholder cannot be resolved; duration strings with time units; typos in the value.
Related errors
- The supplied 'main-class' value of '${mainClassName}' does n
- Either @ConfigRoot or @ConfigMapping is missing on ${configR
- Unable to load the config property type: ${className}
- Unknown password type: ${passwordType}
- Invalid @Scheduled method '<method>': 'fixedDelay' not suppo
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/4380548a497f2bb1.
Report an issue: GitHub.