apache/druid · error · IAE

Unknown class type [ ] for valueId [ ]

Error message

Unknown class type [%s] for valueId [%s]

What it means

GuiceInjectableValues.findInjectableValue() maps special value ids (e.g. Properties-based config keys) to injected values. This IAE is thrown when the Jackson ValueId passed in is of a class type the lookup does not recognize, so the injection cannot be resolved.

Solutions

  1. Check which valueId class is printed in the message and trace the deserializer that produced it
  2. Use GuiceInjectableValues.KnownKeyType (or supported id types) when requesting injectable values
  3. Align Jackson versions (druid-jackson bindings expect a compatible jackson-databind)
  4. Remove/fix custom InjectableValues registrations that pass foreign id types

Example fix

// before
injectableValues.findInjectableValue(new MyCustomKey(...), ctx, forProperty, beanProperty);
// after
injectableValues.findInjectableValue(new GuiceInjectableValues.KnownKeyType("some.property"), ctx, forProperty, beanProperty);
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(valueId instanceof GuiceInjectableValues.KnownKeyType)
    && !(valueId instanceof JsonParser.ValueId)) {
  throw new IllegalArgumentException("Unsupported injectable valueId type");
}

Type guard

static boolean isSupportedValueId(Object valueId) {
  return valueId instanceof GuiceInjectableValues.KnownKeyType;
}

Try / catch

try { resolveInjectable(valueId); } catch (IAE e) {
  if (e.getMessage().startsWith("Unknown class type")) { log.error("Bad injectable id: {}", valueId); }
  throw e;
}

Prevention

When it happens

Trigger: A Jackson deserializer requests injection of a value whose id is not a GuiceInjectableValues.KnownKeyType (or the other supported id types), typically when custom Jackson injectable values are registered or a custom deserializer calls injectableValueIds with a foreign id type.

Common situations: Mixing Jackson versions where JsonParser.ValueId semantics changed; registering a custom InjectableValues that passes unexpected id objects; custom deserializers doing injectableValue lookup with raw keys.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/21c25d116dca112a. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/guice/GuiceInjectableValues.java:77

    // great care
    if (nullables.get().contains((Key) valueId)) {
      return null;
    } else if (valueId instanceof Key) {
      try {
        return injector.getInstance((Key) valueId);
      }
      catch (ConfigurationException ce) {
        // check if nullable annotation is present for this
        if (forProperty.getAnnotation(Nullable.class) != null) {
          HashSet<Key> encounteredNullables = new HashSet<>(nullables.get());
          encounteredNullables.add((Key) valueId);
          nullables.set(encounteredNullables);
          return null;
        }
        throw ce;
      }
    }
    throw new IAE(
        "Unknown class type [%s] for valueId [%s]",
        valueId.getClass().getName(),
        valueId.toString()
    );
  }
}

View on GitHub (pinned to 9b90983fd2)