FasterXML/jackson-databind · error · UnsupportedOperationException

Class {} does not override `withBeanProperties()`, needs to

Error message

Class {} does not override `withBeanProperties()`, needs to

What it means

Thrown by the default BeanDeserializerBase.withBeanProperties() implementation, which is a non-abstract mutant-factory method that throws UnsupportedOperationException. Subclasses of BeanDeserializerBase are expected to override this to support property map replacement during deserialization pipeline setup. If a custom or framework subclass fails to override it, calling withBeanProperties throws with a message identifying the offending class.

Source

Thrown at src/main/java/tools/jackson/databind/deser/bean/BeanDeserializerBase.java:491

        _serializationShape = src._serializationShape;

        _vanillaProcessing = src._vanillaProcessing;

        _externalTypeIdHandler = src._externalTypeIdHandler;
    }

    public abstract BeanDeserializerBase withObjectIdReader(ObjectIdReader oir);

    public abstract BeanDeserializerBase withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps);

    public abstract BeanDeserializerBase withIgnoreAllUnknown(boolean ignoreUnknown);

    /**
     * Mutant factory method that custom sub-classes must override; not left as
     * abstract to prevent more drastic backwards compatibility problems.
     */
    public BeanDeserializerBase withBeanProperties(BeanPropertyMap props) {
        throw new UnsupportedOperationException("Class "+getClass().getName()
                +" does not override `withBeanProperties()`, needs to");
    }

    @Override
    public abstract ValueDeserializer<Object> unwrappingDeserializer(DeserializationContext ctxt,
            NameTransformer unwrapper);

    /**
     * Fluent factory for creating a variant that can handle
     * POJO output as a JSON Array. Implementations may ignore this request
     * if no such input is possible.
     */
    protected abstract BeanDeserializerBase asArrayDeserializer();

    // @since 3.0
    protected abstract void initNameMatcher(DeserializationContext ctxt);

    /*

View on GitHub (pinned to a50c7d2a1d)

Solutions

  1. Override withBeanProperties(BeanPropertyMap props) in your custom BeanDeserializerBase subclass to return a new instance with the updated property map.
  2. If extending BeanDeserializer, check which mutant factory methods it overrides and mirror that pattern.
  3. Avoid subclassing BeanDeserializerBase directly; extend BeanDeserializer instead to inherit more overridden methods.
  4. After a Jackson upgrade, check the base class for newly added mutant-factory methods and override them.

Example fix

// before
public class CustomDeserializer extends BeanDeserializerBase {
    // missing withBeanProperties override
}
// after
public class CustomDeserializer extends BeanDeserializerBase {
    @Override
    public BeanDeserializerBase withBeanProperties(BeanPropertyMap props) {
        return new CustomDeserializer(this, props);
    }
}
Defensive patterns

Strategy: validation

Validate before calling

// At startup, verify custom deserializer overrides withBeanProperties
BeanDeserializerBase custom = ...;
try {
    custom.withBeanProperties(mockPropertyMap);
} catch (UnsupportedOperationException e) {
    throw new IllegalStateException("Custom deserializer missing withBeanProperties override", e);
}

Type guard

static boolean overridesWithBeanProperties(Class<?> deserClass) {
    try {
        return deserClass.getMethod("withBeanProperties", BeanPropertyMap.class)
            .getDeclaringClass() != BeanDeserializerBase.class;
    } catch (NoSuchMethodException e) { return false; }
}

Prevention

When it happens

Trigger: Subclassing BeanDeserializerBase (or BeanDeserializer) without overriding withBeanProperties(). The framework calls withBeanProperties during contextualization or when applying name-based filtering (e.g., @JsonIgnoreProperties at the property level).

Common situations: Writing a custom BeanDeserializer that extends BeanDeserializerBase but does not override all required mutant factory methods. Using a Jackson version where a new mutant-factory method was added but a custom subclass was not updated. Third-party Jackson extensions that extend the base class.

Related errors


AI-assisted analysis of FasterXML/jackson-databind@a50c7d2a1d (2026-08-06). Data as JSON: /api/errors/581c18448ba46813. Report an issue: GitHub.