hibernate/hibernate-orm · error · PropertyAccessException

IllegalAccessException occurred while calling

Error message

IllegalAccessException occurred while calling

What it means

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

Source

Thrown at hibernate-core/src/main/java/org/hibernate/property/access/spi/GetterMethodImpl.java:58

		try {
			return getterMethod.invoke( owner, ArrayHelper.EMPTY_OBJECT_ARRAY );
		}
		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",
					false,
					containerClass,
					propertyName
			);
		}
		catch (IllegalAccessException iae) {
			throw new PropertyAccessException(
					iae,
					"IllegalAccessException occurred while calling",
					false,
					containerClass,
					propertyName
			);
			//cannot occur
		}
		catch (IllegalArgumentException iae) {
			CORE_LOGGER.illegalPropertyGetterArgument( containerClass.getName(), propertyName );
			throw new PropertyAccessException(
					iae,
					"IllegalArgumentException occurred calling",
					false,
					containerClass,
					propertyName
			);
		}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Make the getter method public or accessible to Hibernate's reflection.
  2. Open the package/module to Hibernate if running on the module path.

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/30d479398f703f12. Report an issue: GitHub.