hibernate/hibernate-orm · error · PropertyAccessException

NullPointerException occurred while calling

Error message

NullPointerException occurred while calling

What it means

Error "NullPointerException occurred while calling" thrown in hibernate/hibernate-orm.

Source

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

	}

	@Override
	public void set(Object target, @Nullable Object value) {
		try {
			setterMethod.invoke( target, value );
		}
		catch (NullPointerException npe) {
			if ( value == null && isPrimitive ) {
				throw new PropertyAccessException(
						npe,
						"Null value was assigned to a property of primitive type",
						true,
						containerClass,
						propertyName
				);
			}
			else {
				throw new PropertyAccessException(
						npe,
						"NullPointerException occurred while calling",
						true,
						containerClass,
						propertyName
				);
			}
		}
		catch (InvocationTargetException ite) {
			final var cause = ite.getCause();
			if ( cause instanceof Error error ) {
				// HHH-16403 Don't wrap Error
				throw error;
			}
			throw new PropertyAccessException(
					cause,
					"Exception occurred inside",
					true,

View on GitHub (pinned to fad1729dce)

Solutions

  1. Ensure the target object passed to the setter is non-null (initialize proxies/entities first).
  2. Check for premature access on an uninitialized proxy.

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/336e6589309ecdf0. Report an issue: GitHub.