hibernate/hibernate-orm · error · HibernateException
ServiceRegistry not yet injected…
Error message
ServiceRegistry not yet injected; PropertyAccessStrategyResolver not ready for use.
What it means
Service-lifecycle guard in the property-access strategy resolver: strategySelectorService() was called before the service registry was injected into this service, so strategy resolution cannot proceed. This is an initialization-order problem (service used before its injectServices happened), not a user input error.
Solutions
- Access the PropertyAccessStrategyResolver only after bootstrap completes and the ServiceRegistry is injected.
- Resolve strategies through the SessionFactory's ServiceRegistry instead of a manually created instance.
Defensive patterns
Strategy: validation
When it happens
Trigger: A runtime precondition of the Hibernate API is violated.
Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/515773f6b6f76203.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyResolverStandardImpl.java:77
else {
return BASIC.getStrategy();
}
}
protected PropertyAccessStrategy resolveExplicitlyNamedPropertyAccessStrategy(String explicitAccessStrategyName) {
final var builtInStrategyEnum = BuiltInPropertyAccessStrategies.interpret( explicitAccessStrategyName );
return builtInStrategyEnum != null
? builtInStrategyEnum.getStrategy()
: strategySelectorService().resolveStrategy( PropertyAccessStrategy.class, explicitAccessStrategyName );
}
private @Nullable StrategySelector strategySelectorService;
protected StrategySelector strategySelectorService() {
if ( strategySelectorService == null ) {
if ( serviceRegistry == null ) {
throw new HibernateException( "ServiceRegistry not yet injected; PropertyAccessStrategyResolver not ready for use." );
}
strategySelectorService = serviceRegistry.requireService( StrategySelector.class );
}
return strategySelectorService;
}
}
View on GitHub (pinned to fad1729dce)