hibernate/hibernate-orm · error · TransformationException

Error transforming <any/> : {}

Error message

Error transforming <any/> : {}

What it means

Error "Error transforming <any/> : {}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java:2200

				catch (Exception e) {
					throw new TransformationException( "Error transforming <one-to-one/> : " + hbmOneToOne.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof JaxbHbmManyToOneType hbmManyToOne ) {
				try {
					transferManyToOne( managedTypeInfo, attributes, hbmManyToOne );
				}
				catch (Exception e) {
					throw new TransformationException( "Error transforming <many-to-one/> : " + hbmManyToOne.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof JaxbHbmAnyAssociationType any ) {
				try {
					final var propertyInfo = managedTypeInfo.propertyInfoMap().get( any.getName() );
					attributes.getAnyMappingAttributes().add( transformAnyAttribute( any, propertyInfo ) );
				}
				catch (Exception e) {
					throw new TransformationException( "Error transforming <any/> : " + any.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof PluralAttributeInfo hbmCollection ) {
				final var propertyInfo = managedTypeInfo.propertyInfoMap().get( hbmCollection.getName() );
				if ( hbmCollection.getElement() != null || hbmCollection.getCompositeElement() != null ) {
					try {
						attributes.getElementCollectionAttributes().add( transformElementCollection( roleBase, hbmCollection, propertyInfo ) );
					}
					catch (Exception e) {
						throw new TransformationException( "Error transforming element-collection : " + hbmCollection.getName(), e, origin() );
					}
				}
				else if ( hbmCollection.getOneToMany() != null ) {
					try {
						attributes.getOneToManyAttributes().add( transformOneToMany( hbmCollection, propertyInfo ) );
					}
					catch (Exception e) {
						throw new TransformationException( "Error transforming one-to-many : " + hbmCollection.getName(), e, origin() );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Check the <any/> element's meta-type and id-type attributes and its <meta-value> mappings.
  2. Ensure all discriminator values map to existing entity classes.
  3. Inspect the causal exception for the exact transformation failure.

When it happens

Trigger: The hbm.xml to mapping.xml transformer hits an unexpected structure.

Common situations: Converting legacy hbm.xml documents containing constructs the transformer does not handle.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/c35f5b47a524f4a1. Report an issue: GitHub.