apache/flink · error · IllegalArgumentException

Unknown resolve order: {resolveOrder}

Error message

Unknown resolve order: {resolveOrder}

What it means

ResolveOrder.fromString parses the 'classloader.resolve-order' config string: 'parent-first' and 'child-first' (case-insensitive) map to enum constants; anything else throws IllegalArgumentException("Unknown resolve order: " + resolveOrder). This is the user-facing guard for the classloader resolve-order setting — it fails fast at job/client startup on a bad config value.

Source

Thrown at flink-core/src/main/java/org/apache/flink/util/FlinkUserCodeClassLoaders.java:123

    private static MutableURLClassLoader wrapWithSafetyNet(
            FlinkUserCodeClassLoader classLoader, boolean check) {
        return check
                ? new SafetyNetWrapperClassLoader(classLoader, classLoader.getParent())
                : classLoader;
    }

    /** Class resolution order for Flink URL {@link ClassLoader}. */
    public enum ResolveOrder {
        CHILD_FIRST,
        PARENT_FIRST;

        public static ResolveOrder fromString(String resolveOrder) {
            if (resolveOrder.equalsIgnoreCase("parent-first")) {
                return PARENT_FIRST;
            } else if (resolveOrder.equalsIgnoreCase("child-first")) {
                return CHILD_FIRST;
            } else {
                throw new IllegalArgumentException("Unknown resolve order: " + resolveOrder);
            }
        }
    }

    /**
     * Regular URLClassLoader that first loads from the parent and only after that from the URLs.
     */
    @Internal
    public static class ParentFirstClassLoader extends FlinkUserCodeClassLoader {

        ParentFirstClassLoader(
                URL[] urls, ClassLoader parent, Consumer<Throwable> classLoadingExceptionHandler) {
            super(urls, parent, classLoadingExceptionHandler);
        }

        static {
            ClassLoader.registerAsParallelCapable();
        }

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Set classloader.resolve-order: child-first (or parent-first) exactly, hyphenated and lowercase-insensitive
  2. Search flink-conf.yaml, job-submission options and programmatic Configuration for the key 'classloader.resolve-order' and correct every occurrence
  3. If migrating vendor config, map its values onto Flink's two supported strings before submission

Example fix

# before
classloader.resolve-order: child_first

# after
classloader.resolve-order: child-first
Defensive patterns

Strategy: validation

Validate before calling

String v = conf.getString("classloader.resolve-order", "child-first");
if (!v.equalsIgnoreCase("child-first") && !v.equalsIgnoreCase("parent-first")) {
    throw new IllegalArgumentException("classloader.resolve-order must be child-first or parent-first: " + v);
}

Prevention

When it happens

Trigger: Setting classloader.resolve-order to a misspelled or unsupported value in flink-conf.yaml, e.g. 'childfirst', 'child_first', 'parent_first', or vendor-specific values like 'app-first'.

Common situations: Copy-pasted config from other systems (some use parent_first with underscores); older docs or blog posts using wrong spellings; fat-fingered YAML values.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/6c64dcd73870bae9. Report an issue: GitHub.