{"record":{"id":"c058b3abd043d307","repo":"apache/dolphinscheduler","slug":"run-type-is-required-but-it-is-null-now","errorCode":null,"errorMessage":"run type is required, but it is null now.","messagePattern":"run type is required, but it is null now\\.","errorType":"validation","errorClass":"RunTypeNotFoundException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java","lineNumber":103,"sourceCode":"            // 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\n            // when\n            // building the command\n            // Step 3: to run the command\n            String command = null;\n            switch (javaParameters.getRunType()) {\n\n                case JavaConstants.RUN_TYPE_FAT_JAR:\n                    command = buildJarCommand();\n                    break;\n                case JavaConstants.RUN_TYPE_NORMAL_JAR:\n                    command = buildNormalJarCommand();\n                    break;\n                default:\n                    throw new RunTypeNotFoundException(\"run type is required, but it is null now.\");\n            }\n            Preconditions.checkNotNull(command, \"command not be null.\");\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(command);\n            TaskResponse taskResponse = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            log.info(\"java task run result: {}\", taskResponse);\n            setExitStatusCode(taskResponse.getExitStatusCode());\n            setAppIds(taskResponse.getAppIds());\n            setProcessId(taskResponse.getProcessId());\n            setTaskOutputParams(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            log.error(\"java task interrupted \", e);\n            setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);\n            Thread.currentThread().interrupt();\n        } catch (RunTypeNotFoundException e) {\n            log.error(e.getMessage());\n            setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);\n            throw e;","sourceCodeStart":85,"sourceCodeEnd":121,"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#L85-L121","documentation":"A state guard in JavaTask.handle: javaParameters.getRunType() is null (or unmatched by the switch), so the task cannot decide between FAT_JAR and normal JAR execution modes. The offending input is the runType field of the task params — unset in the definition or lost in a version migration; nothing has been executed yet.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set runType in the Java task definition to a supported value (FAT_JAR or normal JAR mode constant)","Re-save the task in the current UI version so defaults are populated"],"exampleFix":null,"handlingStrategy":"type-guard","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-14T05:17:10.506Z"}