hibernate/hibernate-orm · error · IllegalArgumentException
The provided {} setting value [{}] is not supported
Error message
The provided {} setting value [{}] is not supported What it means
Thrown by EntityManagerFactoryBuilderImpl.loadSettingInstance() as an IllegalArgumentException when the value supplied for a class-typed setting is neither an instance of the expected type, nor a Class object, nor a String. loadSettingInstance only supports those three forms, so any other Java object (Integer, Boolean, enum, custom type) is rejected at boot with the setting name and offending value in the message.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java:1725
instanceClass = (Class<? extends T>) settingValue;
}
else if ( settingValue instanceof String className ) {
if ( standardServiceRegistry != null ) {
instanceClass =
standardServiceRegistry.requireService( ClassLoaderService.class )
.classForName( className );
}
else {
try {
instanceClass = (Class<? extends T>) Class.forName( className );
}
catch (ClassNotFoundException e) {
throw new IllegalArgumentException( "Can't load class: " + className, e );
}
}
}
else {
throw new IllegalArgumentException( "The provided " + settingName
+ " setting value [" + settingValue + "] is not supported" );
}
if ( instanceClass != null ) {
try {
return instanceClass.newInstance();
}
catch (InstantiationException | IllegalAccessException e) {
throw new IllegalArgumentException(
"The " + clazz.getSimpleName() +" class [" + instanceClass + "] could not be instantiated",
e
);
}
}
else {
return null;
}
}View on GitHub (pinned to fad1729dce)
Solutions
- Change the value to the fully-qualified class name string of your implementation.
- Or pass the Class object itself (MyInterceptor.class) in programmatic configuration.
- Or pass a pre-constructed instance of the implementation.
- Audit the config source that produced the value (message shows it) and fix its type conversion.
Example fix
// before
Map<String,Object> settings = new HashMap<>();
settings.put("hibernate.session_factory.observer", 42); // unsupported type
// after
settings.put("hibernate.session_factory.observer", MyObserver.class.getName()); Defensive patterns
Strategy: validation
Validate before calling
// only the 3 supported forms are allowed
Object v = settings.get(SETTING_KEY);
if (!(v instanceof String || v instanceof Class || expectedType.isInstance(v))) {
throw new IllegalArgumentException(SETTING_KEY + " must be an instance, Class, or FQCN String, got: " + (v == null ? "null" : v.getClass()));
} Prevention
- Standardize on FQCN strings for XML/properties config and Class/instance objects for programmatic config.
- Type any programmatic config maps so accidental boxing/enums cannot slip in.
When it happens
Trigger: Putting a non-String/Class/instance object into configurationValues for a setting handled by loadSettingInstance - e.g. an enum constant, a boxed primitive, or a config-binding object from a typed config source (Spring's Environment adapters, MicroProfile Config converters).
Common situations: Migration from String-based properties to typed configuration maps where a converter already produced a non-String object; copy-pasting a value of the wrong type into a bootstrap config map; frameworks injecting typed values where Hibernate expects instance/Class/FQCN-string.
Related errors
- The {storageEngine} storage engine is not supported
- AttributeConverter class [%s] registered multiple times
- Duplicate generator name '%s'; you will likely want to set t
- Duplicate named query '%s'
- Duplicate named stored procedure '{}'
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/19754d38c391ad60.
Report an issue: GitHub.