hibernate/hibernate-orm · error · IllegalArgumentException
value must be a string or boolean
Error message
value must be a string or boolean: {} What it means
Config parsing guard in ConfigurationHelper.getBoolean: the setting value is neither a Boolean nor a String parseable as a boolean — a sentinel check on the raw setting value's type.
Solutions
- Provide the configuration value as a String or Boolean; convert other types before setting the property.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java:104 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/d2d0e9959c262118.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java:104
return integer;
}
else if ( value instanceof String string ) {
return Integer.valueOf( string );
}
else {
throw new IllegalArgumentException( "value must be a string or integer: " + value );
}
}
public static Boolean getBoolean(Object value) {
if ( value instanceof Boolean bool ) {
return bool;
}
else if ( value instanceof String string ) {
return Boolean.valueOf( string );
}
else {
throw new IllegalArgumentException( "value must be a string or boolean: " + value );
}
}
public static CacheMode getCacheMode(Object value) {
if ( value == null ) {
return null;
}
else if ( value instanceof CacheMode cacheMode ) {
return cacheMode;
}
else {
return CacheMode.valueOf( value.toString().toUpperCase( Locale.ROOT ) );
}
}
}
View on GitHub (pinned to fad1729dce)