{"record":{"id":"8d8223b9a6476e1a","repo":"apache/dolphinscheduler","slug":"java-task-params-is-not-valid","errorCode":null,"errorMessage":"java task params is not valid","messagePattern":"java task params is not valid","errorType":"validation","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java","lineNumber":71,"sourceCode":"\n    private final ShellCommandExecutor shellCommandExecutor;\n\n    public JavaTask(TaskExecutionContext taskRequest) {\n        super(taskRequest);\n        this.taskRequest = taskRequest;\n        this.shellCommandExecutor = new ShellCommandExecutor(taskRequest);\n    }\n\n    /**\n     * Initializes a Java task\n     *\n     * @return void\n     **/\n    @Override\n    public void init() {\n        javaParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), JavaParameters.class);\n        if (javaParameters == null || !javaParameters.checkParameters()) {\n            throw new TaskException(\"java task params is not valid\");\n        }\n        log.info(\"Initialize java task params {}\", JSONUtils.toPrettyJsonString(javaParameters));\n    }\n\n    /**\n     * Execute Java tasks\n     *\n     * @return void\n     * @throws Exception\n     */\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // Step 1: judge if is java or jar run type.\n            // Step 2 case1: the fat jar run type builds the command directly, adding resource to the java -jar class\n            // when\n            // building the command\n            // Step 2 case2: the normal jar run type builds the command directly, adding resource to the java -cp class","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java#L53-L89","documentation":"A parameter validation guard in JavaTask.init: javaParameters is null after parsing taskParams (invalid JSON) or checkParameters() failed because required fields (e.g. mainClass or run type-related fields) are missing. The offending input is the task definition's parameter JSON; the task fails at init before command construction.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Complete the required Java task fields (mainClass, jvm args, run type, resources)","Ensure taskParams JSON deserializes into JavaParameters — check field names and types","Validate on save in the UI to catch missing fields early"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}