apache/dolphinscheduler · error · RunTypeNotFoundException

run type is required, but it is null now.

Error message

run type is required, but it is null now.

What it means

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.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java:103

            // Step 1: judge if is java or jar run type.
            // Step 2 case1: the fat jar run type builds the command directly, adding resource to the java -jar class
            // when
            // building the command
            // Step 2 case2: the normal jar run type builds the command directly, adding resource to the java -cp class
            // when
            // building the command
            // Step 3: to run the command
            String command = null;
            switch (javaParameters.getRunType()) {

                case JavaConstants.RUN_TYPE_FAT_JAR:
                    command = buildJarCommand();
                    break;
                case JavaConstants.RUN_TYPE_NORMAL_JAR:
                    command = buildNormalJarCommand();
                    break;
                default:
                    throw new RunTypeNotFoundException("run type is required, but it is null now.");
            }
            Preconditions.checkNotNull(command, "command not be null.");
            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
                    .appendScript(command);
            TaskResponse taskResponse = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);
            log.info("java task run result: {}", taskResponse);
            setExitStatusCode(taskResponse.getExitStatusCode());
            setAppIds(taskResponse.getAppIds());
            setProcessId(taskResponse.getProcessId());
            setTaskOutputParams(shellCommandExecutor.getTaskOutputParams());
        } catch (InterruptedException e) {
            log.error("java task interrupted ", e);
            setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);
            Thread.currentThread().interrupt();
        } catch (RunTypeNotFoundException e) {
            log.error(e.getMessage());
            setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);
            throw e;

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set runType in the Java task definition to a supported value (FAT_JAR or normal JAR mode constant)
  2. Re-save the task in the current UI version so defaults are populated
Defensive patterns

Strategy: type-guard

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/c058b3abd043d307. Report an issue: GitHub.