{"record":{"id":"ea3e8e07724d33bd","repo":"apache/skywalking","slug":"slot-value-numtext-exceeds-the-supported-ran","errorCode":null,"errorMessage":"{slot} value '{numText}' exceeds the supported range (must fit in a Java long)","messagePattern":"(.+?) value '(.+?)' exceeds the supported range \\(must fit in a Java long\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALScriptParser.java","lineNumber":894,"sourceCode":"     * which share the lexer NUMBER token with arithmetic expressions but\n     * cannot accept the suffixes/forms supported there. Throws a clear\n     * compile-time error for shape violations and for values that exceed\n     * Java's {@code long} range (rather than letting\n     * {@link NumberFormatException} leak from {@code Long.parseLong}).\n     */\n    private static long parseStrictInteger(final String numText, final String slot) {\n        for (int i = 0; i < numText.length(); i++) {\n            final char c = numText.charAt(i);\n            if (c < '0' || c > '9') {\n                throw new IllegalArgumentException(\n                    slot + \" expects a plain integer literal, got '\" + numText\n                        + \"' (suffixes / decimals / exponents are not accepted here)\");\n            }\n        }\n        try {\n            return Long.parseLong(numText);\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                slot + \" value '\" + numText + \"' exceeds the supported range \"\n                    + \"(must fit in a Java long)\");\n        }\n    }\n\n    /**\n     * Like {@link #parseStrictInteger} but additionally requires the value\n     * to fit in a Java {@code int}. Used by the {@code [index]} grammar\n     * slot, where silent narrowing of an oversized literal would wrap to a\n     * negative index instead of producing a clear error.\n     */\n    private static int parseStrictInt(final String numText, final String slot) {\n        final long value = parseStrictInteger(numText, slot);\n        if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {\n            throw new IllegalArgumentException(\n                slot + \" value '\" + numText + \"' exceeds the supported range \"\n                    + \"(must fit in a Java int)\");\n        }","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALScriptParser.java#L876-L912","documentation":"Thrown from the MeterSystem constructor during function discovery: a class annotated with @MeterFunction does not implement AcceptableValue. Every meter function must be an AcceptableValue implementation so the meter pipeline can feed values into it; the scan enforces this contract at boot and fails fast.","triggerScenarios":"Deploying a custom jar on the OAP classpath under org.apache.skywalking that carries @MeterFunction on a class not implementing AcceptableValue. Standard shipped functions all implement it, so this only fires with custom/patched meter function classes.","commonSituations":"Writing a custom MAL function and annotating the dispatcher class but putting the annotation on the wrong class; copying an existing function and stripping the interface; version-mismatched custom plugin compiled against an older API.","solutions":["Make the annotated class implement AcceptableValue<T> (and normally extend the Dispatcher/MeterFunction base used by shipped functions)","Verify the annotation sits on the function class itself, not on a helper or config class","Recompile the custom plugin against the OAP server-core version actually deployed"],"exampleFix":"// before\n@MeterFunction(functionName = \"my_func\")\nclass MyFunc { } // doesn't implement AcceptableValue\n// after\n@MeterFunction(functionName = \"my_func\")\nclass MyFunc implements AcceptableValue<Long> { ... }","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean validFunction = cls.isAnnotationPresent(MeterFunction.class)\n    && org.apache.skywalking.oap.server.core.analysis.meter.function.AcceptableValue.class.isAssignableFrom(cls);","tryCatchPattern":null,"preventionTips":["Every @MeterFunction class must implement AcceptableValue<T>","Run OAP boot in a staging environment with custom plugins before production"],"tags":["skywalking","oap","meter","mal","plugin","contract"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}