hibernate/hibernate-orm · error · PropertySetterAccessException

IllegalArgumentException occurred while calling setter for p

Error message

IllegalArgumentException occurred while calling setter for property [%s.%s (expected type = %s)]; target = [%s], property value = [%s]

What it means

Error "IllegalArgumentException occurred while calling setter for property [%s.%s (expected type = %s)]; target = [%s], property value = [%s]" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/property/access/spi/SetterMethodImpl.java:100

					propertyName
			);
			//cannot occur
		}
		catch (IllegalArgumentException iae) {
			if ( value == null && isPrimitive ) {
				throw new PropertyAccessException(
						iae,
						"Null value was assigned to a property of primitive type",
						true,
						containerClass,
						propertyName
				);
			}
			else {
				final var expectedType = setterMethod.getParameterTypes()[0];
				CORE_LOGGER.illegalPropertySetterArgument( containerClass.getName(), propertyName );
				CORE_LOGGER.expectedType( expectedType.getName(), value == null ? null : value.getClass().getName() );
				throw new PropertySetterAccessException(
						iae,
						containerClass,
						propertyName,
						expectedType,
						target,
						value
				);
			}
		}
	}

	public Class<?> getContainerClass() {
		return containerClass;
	}

	@Override
	public String getMethodName() {
		return setterMethod.getName();

View on GitHub (pinned to fad1729dce)

Solutions

  1. Pass a value assignable to the property's declared type.
  2. Register an AttributeConverter if the persisted type differs from the property type.

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/3d1c5c3074263a5d. Report an issue: GitHub.