{"record":{"id":"0ff6f68e96840b9b","repo":"alibaba/arthas","slug":"groovy-command-is-not-supported-yet","errorCode":null,"errorMessage":"groovy command is not supported yet!","messagePattern":"groovy command is not supported yet!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"info","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/GroovyScriptCommand.java","lineNumber":79,"sourceCode":"    public String getClassPattern() {\n        return classPattern;\n    }\n\n    public String getMethodPattern() {\n        return methodPattern;\n    }\n\n    public String getScriptFilepath() {\n        return scriptFilepath;\n    }\n\n    public boolean isRegEx() {\n        return isRegEx;\n    }\n\n    @Override\n    protected Matcher getClassNameMatcher() {\n        throw new UnsupportedOperationException(\"groovy command is not supported yet!\");\n    }\n\n    @Override\n    protected Matcher getClassNameExcludeMatcher() {\n        throw new UnsupportedOperationException(\"groovy command is not supported yet!\");\n    }\n\n    @Override\n    protected Matcher getMethodNameMatcher() {\n        throw new UnsupportedOperationException(\"groovy command is not supported yet!\");\n    }\n\n    @Override\n    protected AdviceListener getAdviceListener(CommandProcess process) {\n        throw new UnsupportedOperationException(\"groovy command is not supported yet!\");\n    }\n}\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/GroovyScriptCommand.java#L61-L97","documentation":"Thrown as UnsupportedOperationException by GroovyScriptCommand.getClassNameMatcher. The GroovyScriptCommand class is a stub/placeholder: it declares the command surface (script filepath, regex flag, accessors) but every monitoring hook that would actually drive a groovy script throws 'not supported yet'. getClassNameMatcher is the matcher resolver overridden from the monitor base class; invoking it indicates the command was reached.","triggerScenarios":"Run a 'groovy' (monitor-style) command that triggers matcher resolution — e.g. the command lifecycle calls getClassNameMatcher() to compile the class-name pattern. The feature is unimplemented, so any real invocation fails.","commonSituations":"User or scripting layer invokes the groovy command expecting it to work; copy of a monitor command pattern adapted to groovy; leftover references to an experimental feature.","solutions":["Do not use the groovy command — it is not implemented; use a supported monitor/watch/trace command instead.","If you need scripting, run scripts via an external mechanism against the target, not through this command.","Remove references to GroovyScriptCommand from any command registry/wiring if it should not be exposed."],"exampleFix":"// before\nGroovyScriptCommand cmd = ...; Matcher m = cmd.getClassNameMatcher();\n\n// after\n// use the implemented watch/trace/monitor command instead of the stub","handlingStrategy":"fallback","validationCode":"if (cmd instanceof GroovyScriptCommand) { // do not invoke getClassNameMatcher; route to watch/trace/monitor }","typeGuard":"static boolean isImplementedCommand(Command c) { return !(c instanceof GroovyScriptCommand); }","tryCatchPattern":"try { Matcher m = cmd.getClassNameMatcher(); } catch (UnsupportedOperationException e) { // use watch/trace/monitor instead }","preventionTips":["Treat the groovy command as unavailable.","Filter GroovyScriptCommand out of any command menus/exposure.","Document that scripting is not supported via this command."],"tags":["groovy","unsupported","monitor","stub"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}