hibernate/hibernate-orm · error · HibernateException

Unable to create instance from incoming ClassDetails

Error message

Unable to create instance from incoming ClassDetails - %s

What it means

Reflection helper that instantiates a class from ClassDetails via its no-arg constructor; any reflective failure (missing constructor, inaccessible, non-instantiable) is wrapped and rethrown with this message naming the ClassDetails involved. The faulty input is the target class of the instantiation.

Solutions

  1. Check the named class exists on the classpath and has an accessible constructor; inspect the wrapped cause for details.

Example fix

Check the named class exists on the classpath and has an accessible constructor; inspect the wrapped cause for details.
Defensive patterns

Strategy: try-catch

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/b475b415e3c5dafa. Report an issue: GitHub.

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/DynamicModelHelper.java:748

	}

	private static TypeDetails resolveCollectionType(Class<?> collectionType, XmlDocumentContext xmlDocumentContext) {
		final var classDetails = xmlDocumentContext
				.getBootstrapContext()
				.getModelsContext()
				.getClassDetailsRegistry()
				.resolveClassDetails( collectionType.getName() );
		return new ClassTypeDetailsImpl( classDetails, TypeDetails.Kind.CLASS );
	}

	@Nonnull
	private static <T> T createInstance(ClassDetails classDetails) {
		try {
			//noinspection unchecked
			return (T) classDetails.toJavaClass().getConstructor().newInstance();
		}
		catch (Exception e) {
			throw new HibernateException( "Unable to create instance from incoming ClassDetails - " + classDetails );
		}
	}
}

View on GitHub (pinned to fad1729dce)