apache/flink · error · IllegalArgumentException
Unknown class resolution order: {resolveOrder}
Error message
Unknown class resolution order: {resolveOrder} What it means
FlinkUserCodeClassLoaders.getClassLoader(...) switch-cases the ResolveOrder enum: CHILD_FIRST and PARENT_FIRST each build a loader; any other value hits the default branch and throws IllegalArgumentException("Unknown class resolution order: " + resolveOrder). Because the enum only has two constants, this is only reachable if someone passes a null or a cast/modified enum value programmatically — config strings normally arrive via ResolveOrder.fromString.
Source
Thrown at flink-core/src/main/java/org/apache/flink/util/FlinkUserCodeClassLoaders.java:100
URL[] urls,
ClassLoader parent,
String[] alwaysParentFirstPatterns,
Consumer<Throwable> classLoadingExceptionHandler,
boolean checkClassLoaderLeak) {
switch (resolveOrder) {
case CHILD_FIRST:
return childFirst(
urls,
parent,
alwaysParentFirstPatterns,
classLoadingExceptionHandler,
checkClassLoaderLeak);
case PARENT_FIRST:
return parentFirst(
urls, parent, classLoadingExceptionHandler, checkClassLoaderLeak);
default:
throw new IllegalArgumentException(
"Unknown class resolution order: " + resolveOrder);
}
}
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")) {View on GitHub (pinned to 2f3c205e92)
Solutions
- Pass a value obtained from ResolveOrder.fromString(...) so config strings map to a valid constant
- If you forked Flink and added a ResolveOrder constant, add a matching case to this switch
- Null-check the resolve order before calling and default it to the documented value (child-first)
Example fix
// before
FlinkUserCodeClassLoaders.getUrlClassLoader(urls, parent, null, handler, false); // null order
// after
ResolveOrder order = ResolveOrder.fromString(
conf.get(CoreOptions.CLASSLOADER_RESOLVE_ORDER)); // 'child-first'/'parent-first' Defensive patterns
Strategy: validation
Validate before calling
ResolveOrder order = ResolveOrder.fromString(conf.get(CoreOptions.CLASSLOADER_RESOLVE_ORDER));
Prevention
- Always map config strings through ResolveOrder.fromString before calling classloader factories
- Fork maintainers: extend the switch when adding enum constants
When it happens
Trigger: Programmatically calling FlinkUserCodeClassLoaders.getClassLoader / childFirst / parentFirst factory paths with a null ResolveOrder or an enum constant added by a fork/patch; reflective invocation passing the wrong type.
Common situations: Custom Flink forks adding a new resolve order without extending the switch; passing an unresolved config value straight into the API instead of using ResolveOrder.fromString(CoreOptions.CLASSLOADER_RESOLVE_ORDER).
Related errors
- Method createProcTime isn't supported in PartitionTimeCommit
- Method currentProcTime isn't supported in PartitionTimeCommi
- Method currentWatermark isn't supported in ProcTimeCommitTri
- Unknown resolve order: {resolveOrder}
- Could not instantiate class '%s' of type '%s'. Please make s
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/95eea3f24361bf03.
Report an issue: GitHub.