hibernate/hibernate-orm · error · IllegalArgumentException

value must be a string or boolean: {}

Error message

value must be a string or boolean: {}

What it means

Error "value must be a string or boolean: {}" thrown in hibernate/hibernate-orm.

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)

Solutions

  1. Provide the configuration value as a String or Boolean; convert other types before setting the property.

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.