hibernate/hibernate-orm · error · MappingException
Unexpected collection element type …
Error message
Unexpected collection element type : <pluralAttributeJaxbMapping.getName()>
What it means
HBM plural-attribute binding fell through every recognized element mapping (<element>, <one-to-many>, <many-to-many>, <many-to-any>, <composite-element>, ...): the collection element declaration in the mapping document is absent or of an unrecognized kind. The faulty input is the XML collection mapping named in the message.
Solutions
- Use a supported collection element mapping (<element/>, <one-to-many/>, <many-to-many/>, <composite-element/>, <many-to-any/>) in the hbm.xml collection.
Example fix
Use a supported collection element mapping (<element/>, <one-to-many/>, <many-to-many/>, <composite-element/>, <many-to-any/>) in the hbm.xml collection.
Defensive patterns
Strategy: validation
When it happens
Trigger: An hbm.xml / orm.xml mapping document violates a mapping rule during bootstrap.
Common situations: Legacy XML mappings with invalid combinations (column+formula, mixed inheritance, missing identifiers, bad extends references).
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/af1dcf302a2323b1.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/AbstractPluralAttributeSourceImpl.java:236
);
}
else if ( pluralAttributeJaxbMapping.getManyToMany() != null ) {
return new PluralAttributeElementSourceManyToManyImpl(
sourceMappingDocument(),
this,
pluralAttributeJaxbMapping.getManyToMany()
);
}
else if ( pluralAttributeJaxbMapping.getManyToAny() != null ) {
return new PluralAttributeElementSourceManyToAnyImpl(
sourceMappingDocument(),
this,
pluralAttributeJaxbMapping.getManyToAny(),
pluralAttributeJaxbMapping.getCascade()
);
}
else {
throw new MappingException(
"Unexpected collection element type : " + pluralAttributeJaxbMapping.getName(),
sourceMappingDocument().getOrigin()
);
}
}
@Override
public AttributePath getAttributePath() {
return attributePath;
}
@Override
public AttributeRole getAttributeRole() {
return attributeRole;
}
@Override
public boolean usesJoinTable() {View on GitHub (pinned to fad1729dce)