{"record":{"id":"4380548a497f2bb1","repo":"quarkusio/quarkus","slug":"invalid-paramname-string-value-value-cann","errorCode":null,"errorMessage":"Invalid '<paramName>String' value \"<value>\" - cannot parse into long","messagePattern":"Invalid '<paramName>String' value \"<value>\" - cannot parse into long","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-scheduled/deployment/src/main/java/io/quarkus/spring/scheduled/deployment/SpringScheduledProcessor.java","lineNumber":173,"sourceCode":"        } else { //param value as String e.g. a placeholder ${value.from.conf} or java.time.Duration compliant value\n            paramValueString = getAnnotationValueByName(springAnnotationValues, paramName + \"String\")\n                    .get().asString();\n            paramValue = valueOf(paramName, paramValueString);\n\n        }\n        return paramValue;\n    }\n\n    private long valueOf(String paramName, String paramValueString) {\n        long paramValue;\n        if (paramValueString.startsWith(\"${\")) {\n            paramValueString = paramValueString.replace(\"${\", \"{\").trim();\n            paramValueString = SchedulerUtils.lookUpPropertyValue(paramValueString);\n        }\n        try {\n            paramValue = Long.valueOf(paramValueString);\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                    \"Invalid '\" + paramName + \"String' value \\\"\" + paramValueString + \"\\\" - cannot parse into long\");\n        }\n        return paramValue;\n    }\n\n    private boolean annotationsValuesContain(List<AnnotationValue> springAnnotationValues, String valueName) {\n        return springAnnotationValues.stream().filter(spv -> spv.name().equals(valueName)).findAny().isPresent();\n    }\n\n    private Optional<AnnotationValue> getAnnotationValueByName(List<AnnotationValue> springAnnotationValues, String valueName) {\n        return springAnnotationValues.stream().filter(spv -> spv.name().equals(valueName)).findAny();\n    }\n}\n","sourceCodeStart":155,"sourceCodeEnd":187,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-scheduled/deployment/src/main/java/io/quarkus/spring/scheduled/deployment/SpringScheduledProcessor.java#L155-L187","documentation":"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.","triggerScenarios":"@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\").","commonSituations":"Config property not set in application.properties so the placeholder cannot be resolved; duration strings with time units; typos in the value.","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)"],"exampleFix":"// before\n@Scheduled(fixedRateString = \"${job.rate}\") // job.rate not set\nvoid run() {}\n\n// after (application.properties: job.rate=5000)\n@Scheduled(fixedRateString = \"${job.rate}\")\nvoid run() {}","handlingStrategy":"validation","validationCode":"String raw = \"${job.rate}\";\nString resolved = resolveProperty(raw); // from application.properties\ntry {\n    Long.parseLong(resolved);\n} catch (NumberFormatException e) {\n    throw new IllegalStateException(\"@Scheduled *String value must be a long: \" + resolved);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["spring-scheduled","number-format","config","build-time","quarkus"],"backgroundTag":"number-format-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}