hibernate/hibernate-orm · error · PropertyAccessSerializationException

Unable to resolve setter method on deserialization : " + dec

Error message

Unable to resolve setter method on deserialization : " + declaringClass.getName() + "#" + methodName + "(" + argumentType.getName() + ")"

What it means

Setter-based property accessors serialize as (declaringClass, methodName, argumentType). On deserialization, AbstractSetterMethodSerialForm.resolveMethod re-locates the Method via getDeclaredMethod(methodName, argumentType); NoSuchMethodException is wrapped in PropertyAccessSerializationException when that exact signature no longer exists on the class.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/property/access/internal/AbstractSetterMethodSerialForm.java:61

		return declaringClass;
	}

	public String getMethodName() {
		return methodName;
	}

	public Class<?> getArgumentType() {
		return argumentType;
	}

	protected Method resolveMethod() {
		try {
			final var method = declaringClass.getDeclaredMethod( methodName, argumentType );
			ReflectHelper.ensureAccessibility( method );
			return method;
		}
		catch (NoSuchMethodException e) {
			throw new PropertyAccessSerializationException(
					"Unable to resolve setter method on deserialization : " + declaringClass.getName() + "#"
							+ methodName + "(" + argumentType.getName() + ")"
			);
		}
	}
}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Invalidate serialized caches after any change to setter signatures on mapped classes
  2. Keep the exact setter name and parameter type stable on classes that participate in serialized state
  3. Rebuild (serialize anew) any stored artifacts once all nodes run the same class version
Defensive patterns

Strategy: try-catch

Try / catch

try (ObjectInputStream in = new ObjectInputStream(bytes)) {
    Object cached = in.readObject();
} catch (org.hibernate.PropertyAccessSerializationException e) {
    // setter (name, argumentType) no longer exists on the class: invalidate and re-serialize
}

Prevention

When it happens

Trigger: Reading back a serialized PropertyAccess after the setter was renamed, removed, or had its parameter type changed (e.g., a setter now accepting a different wrapper type), so the exact (name, argumentType) pair no longer resolves.

Common situations: Entity class refactors between serialize and deserialize; changing a setter parameter type from Integer to int (or to another class) without clearing serialized caches; heterogeneous cluster nodes with different entity builds.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/9720db94760272a3. Report an issue: GitHub.