apache/maven · error · IllegalArgumentException

Expected an Xpp3Dom object but received a {}: {}

Error message

Expected an Xpp3Dom object but received a {}: {}

What it means

Error "Expected an Xpp3Dom object but received a {}: {}" thrown in apache/maven.

Source

Thrown at src/mdo/model-v3.vm:203

        return getDelegate().${pfx}${cap}() != null ? new Xpp3Dom(getDelegate().${pfx}${cap}(), this::replace) : null;
      #else
        return getDelegate().${pfx}${cap}();
      #end
    }

    public void set${cap}(${type} ${field.name}) {
      #if ($field.type == "DOM")
        if (${field.name} instanceof Xpp3Dom xpp3Dom) {
            if (!Objects.equals(xpp3Dom.getDom(), getDelegate().${pfx}${cap}())) {
                update(getDelegate().with${cap}(xpp3Dom.getDom()));
                xpp3Dom.setChildrenTracking(this::replace);
            }
        } else if (${field.name} == null) {
            if (getDelegate().${pfx}${cap}() != null) {
                update(getDelegate().with${cap}(null));
            }
        } else {
            throw new IllegalArgumentException("Expected an Xpp3Dom object but received a " + ${field.name}.getClass() + ": " + ${field.name});
        }
      #elseif( $field.type == "java.util.Properties" )
        LinkedHashMap<String, String> map = new LinkedHashMap<>();
        ${field.name}.forEach((key, value) -> {
            if (value != null) {
                map.put(key.toString(), value.toString());
            }
        });
        if (!Objects.equals(map, getDelegate().get${cap}())) {
            update(getDelegate().with${cap}(map));
        }
      #elseif ( $field.to != "String" && $field.type == "java.util.List" && $field.multiplicity == "*" )
        if (${field.name} == null) {
            ${field.name} = Collections.emptyList();
        }
        if (!Objects.equals(${field.name}, ${pfx}${cap}())) {
            update(getDelegate().with${cap}(
                ${field.name}.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at src/mdo/model-v3.vm:203 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/ef120cdc95027d32. Report an issue: GitHub.