hibernate/hibernate-orm · error · IllegalArgumentException

hibernate.criteria.copy_tree cannot be null

Error message

hibernate.criteria.copy_tree cannot be null

What it means

Error "hibernate.criteria.copy_tree cannot be null" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java:2682

								determineCacheStoreMode( properties ),
								(CacheRetrieveMode) value
						)
				);
				break;
			case JPA_SHARED_CACHE_STORE_MODE:
			case JAKARTA_SHARED_CACHE_STORE_MODE:
				properties.put( JPA_SHARED_CACHE_STORE_MODE, value );
				properties.put( JAKARTA_SHARED_CACHE_STORE_MODE, value );
				setCacheMode(
						interpretCacheMode(
								(CacheStoreMode) value,
								determineCacheRetrieveMode( properties )
						)
				);
				break;
			case CRITERIA_COPY_TREE:
				if ( value == null ) {
					throw new IllegalArgumentException( CRITERIA_COPY_TREE + " cannot be null" );
				}
				setCriteriaCopyTreeEnabled( parseBoolean( value.toString() ) );
				break;
			case HINT_FETCH_PROFILE:
				if ( value == null ) {
					throw new IllegalArgumentException( HINT_FETCH_PROFILE + " cannot be null" );
				}
				enableFetchProfile( value.toString() );
				break;
			case USE_SUBSELECT_FETCH:
			case HINT_ENABLE_SUBSELECT_FETCH:
				setSubselectFetchingEnabled( value != null && parseBoolean( value.toString() ) );
				break;
			case DEFAULT_BATCH_FETCH_SIZE:
			case HINT_BATCH_FETCH_SIZE:
				setFetchBatchSize( value == null ? -1 : parseInt( value.toString() ) );
				break;
			case STATEMENT_BATCH_SIZE:

View on GitHub (pinned to fad1729dce)

Solutions

  1. Set the hibernate.criteria.copy_tree configuration property to a non-null boolean value (true/false) or remove the property to use the default.

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java:2682 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/340088c30518a825. Report an issue: GitHub.