hibernate/hibernate-orm · error · AttributeExtractionException

Attribute (method) {} is not accessible

Error message

Attribute (method) {} is not accessible

What it means

Error "Attribute (method) {} is not accessible" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java:287

		private final String name;
		private final Method method;

		public MethodAttributeAccess(String attributeName, Method method) {
			this.name = attributeName;
			try {
				ReflectHelper.ensureAccessibility( method );
			}
			catch (Exception e) {
				this.method = null;
				return;
			}
			this.method = method;
		}

		@Override
		public Object extractValue(Object owner) {
			if ( method == null ) {
				throw new AttributeExtractionException( "Attribute (method) " + name + " is not accessible" );
			}

			try {
				return method.invoke( owner );
			}
			catch ( IllegalAccessException e ) {
				throw new AttributeExtractionException(
						"Unable to access attribute (method): " + method.getDeclaringClass().getName() + "#" + name,
						e
				);
			}
			catch ( InvocationTargetException e ) {
				throw new AttributeExtractionException(
						"Unable to access attribute (method): " + method.getDeclaringClass().getName() + "#" + name,
						e.getCause()
				);
			}
		}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Make the accessor method public/accessible or switch to field access for that attribute.

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java:287 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/3e5973df457304f4. Report an issue: GitHub.