{"record":{"id":"d84957d28d632606","repo":"Netflix/Hystrix","slug":"wrong-weavingmode-property-supported-array","errorCode":null,"errorMessage":"wrong 'weavingMode' property, supported: \" + Arrays.toString(WeavingMode.values()) + \", actual = \" + EnvUtils.WEAVING_MODE","messagePattern":"wrong 'weavingMode' property, supported: \" \\+ Arrays\\.toString\\(WeavingMode\\.values\\(\\)\\) \\+ \", actual = \" \\+ EnvUtils\\.WEAVING_MODE","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/utils/EnvUtils.java","lineNumber":41,"sourceCode":" * Created by dmgcodevil\n */\npublic final class EnvUtils {\n\t\n\tprivate static final String WEAVING_MODE;\n\t\n\tstatic {\n\t\tWEAVING_MODE = System.getProperty(\"weavingMode\", WeavingMode.RUNTIME.name()).toUpperCase();\n\t}\n\t\n    private EnvUtils(){\n\n    }\n\n    public static WeavingMode getWeavingMode() {\n        try {\n            return WeavingMode.valueOf(EnvUtils.WEAVING_MODE);\n        } catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(\"wrong 'weavingMode' property, supported: \" + Arrays.toString(WeavingMode.values()) + \", actual = \" + EnvUtils.WEAVING_MODE, e);\n        }\n    }\n\n    public static boolean isCompileWeaving() {\n        return WeavingMode.COMPILE == getWeavingMode();\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":49,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/utils/EnvUtils.java#L23-L49","documentation":"Javanica supports two AspectJ weaving modes via the system property 'weavingMode' (default RUNTIME). EnvUtils.getWeavingMode() parses that property with WeavingMode.valueOf; an unrecognized value (case-sensitive, and note the stored value is uppercased but must still match COMPILE or RUNTIME) throws IllegalArgumentException listing the supported values and the actual value found.","triggerScenarios":"Running the JVM with -DweavingMode=compile-time, -DweavingMode=binary, or a typo like -DweavingMode=runntime; a build script or IDE run configuration injecting the wrong value.","commonSituations":"Switching a project from load-time weaving (Spring LTW, -javaagent:aspectjweaver) to compile-time weaving via annotation build plugins and setting the wrong string; CI pipelines passing the property differently from local runs; stale run configurations after upgrading javanica.","solutions":["Set the property to exactly COMPILE or RUNTIME, e.g. -DweavingMode=COMPILE","If you weave at build time with the AspectJ maven/gradle plugin, use COMPILE; for Spring LTW/Spring AOP proxies use RUNTIME","Search build scripts, IDE run configs, and JAVA_TOOL_OPTIONS for misspelled -DweavingMode values and remove duplicates","Re-run the application"],"exampleFix":"# before\njava -DweavingMode=compile-time -jar app.jar\n\n# after\njava -DweavingMode=COMPILE -jar app.jar","handlingStrategy":"validation","validationCode":"String mode = System.getProperty(\"weavingMode\", \"RUNTIME\").trim().toUpperCase(Locale.ROOT);\nif (!mode.equals(\"RUNTIME\") && !mode.equals(\"COMPILE\"))\n    throw new IllegalStateException(\"weavingMode must be RUNTIME or COMPILE, got: \" + mode);","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { throw new IllegalStateException(\"Fix -DweavingMode (RUNTIME|COMPILE): \" + e.getMessage(), e); }","preventionTips":["Standardize the weavingMode value in one build property inherited by all run configs","Assert the property at app startup before AspectJ wiring kicks in","Document the intended mode next to the aspect configuration"],"tags":["hystrix","javanica","aspectj","weaving","system-property","configuration"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}