hibernate/hibernate-orm · error · MappingException

Unable to complete initialization of boot meta-model

Error message

Unable to complete initialization of boot meta-model

What it means

Progress guard in processValueResolvers: the fixpoint loop over deferred value resolvers completed a full pass without any resolver being satisfied (none returned true/removeIf removed nothing). This indicates an unresolvable - typically circular - set of value dependencies in the boot meta-model.

Solutions

  1. Inspect earlier log entries/exceptions during bootstrap; this error is a wrapper for a root cause that occurred while building the metamodel.
  2. Fix the first reported mapping or configuration error and retry the SessionFactory build.
  3. Enable debug logging for org.hibernate.boot to see which mapping step failed.
Defensive patterns

Strategy: validation

When it happens

Trigger: A delayed second-pass binding fails while finishing the boot metamodel.

Common situations: Unresolved references between mappings (associations, joins, id refs) that only surface at the end of metadata building.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java:1759

			processNaturalIdUniqueKeyBinders();

			processCachingOverrides();

			processValueResolvers( buildingContext );
		}
		finally {
			inSecondPass = false;
		}
	}

	private void processValueResolvers(MetadataBuildingContext buildingContext) {
		if ( valueResolvers != null ) {
			while ( !valueResolvers.isEmpty() ) {
				final boolean anyRemoved =
						valueResolvers.removeIf( resolver -> resolver.apply( buildingContext ) );
				if ( !anyRemoved ) {
					throw new MappingException( "Unable to complete initialization of boot meta-model" );
				}
			}
		}
	}

	private void processSecondPasses(ArrayList<? extends SecondPass> secondPasses) {
		if ( secondPasses != null ) {
			for ( var secondPass : secondPasses ) {
				secondPass.doSecondPass( getEntityBindingMap() );
			}
			secondPasses.clear();
		}
	}

	private void processFkSecondPassesInOrder() {
		if ( fkSecondPassList == null || fkSecondPassList.isEmpty() ) {
			processSecondPasses( secondaryTableFromAnnotationSecondPassesList );
		}

View on GitHub (pinned to fad1729dce)