hibernate/hibernate-orm · error · PropertyAccessBuildingException
Invalid access type " + propertyAccessType + " for property
Error message
Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]
What it means
Error "Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessGetterImpl.java:59
throw new PropertyAccessBuildingException(
"Could not locate field for property named [" + containerJavaType.getName() + "#" + propertyName + "]"
);
}
getter = fieldGetter( containerJavaType, propertyName, field );
break;
}
case PROPERTY: {
final var getterMethod = getterMethodOrNull( containerJavaType, propertyName );
if ( getterMethod == null ) {
throw new PropertyAccessBuildingException(
"Could not locate getter for property named [" + containerJavaType.getName() + "#" + propertyName + "]"
);
}
getter = propertyGetter( containerJavaType, propertyName, getterMethod );
break;
}
default: {
throw new PropertyAccessBuildingException(
"Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]"
);
}
}
}
// --- //
private static Getter fieldGetter(Class<?> containerJavaType, String propertyName, Field field) {
return new GetterFieldImpl( containerJavaType, propertyName, field );
}
private static Getter propertyGetter(Class<?> containerJavaType, String propertyName, Method method) {
return new GetterMethodImpl( containerJavaType, propertyName, method );
}
@Override
public PropertyAccessStrategy getPropertyAccessStrategy() {View on GitHub (pinned to fad1729dce)
Solutions
- Set the property access type to 'field' or 'property' consistently in the mapping/annotations.
- Place @Access(AccessType.FIELD) or PROPERTY at the correct level for the attribute.
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/ad39b6140d1760f1.
Report an issue: GitHub.