hibernate/hibernate-orm · error · ModelsException

Callback method '%s' %s '@%s' in '%s'%s

Error message

Callback method '%s' %s '@%s' in '%s'%s

What it means

Error "Callback method '%s' %s '@%s' in '%s'%s" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/models/spi/LifecycleEventHandler.java:686

				listenerClassDetails,
				callbackAnnotation,
				callbackType,
				methodDetails,
				callbackMethods,
				"annotated"
		);
	}

	private static void setCallbackMethod(
			JpaEventListenerStyle consumerType,
			ClassDetails listenerClassDetails,
			Class<? extends Annotation> callbackAnnotation,
			CallbackType callbackType,
			MethodDetails methodDetails,
			Map<CallbackType, MethodDetails> callbackMethods,
			String source) {
		if ( !matchesSignature( consumerType, methodDetails ) ) {
			throw new ModelsException( "Callback method '"
					+ methodDetails.getName() + "' " + source + " '@"
					+ callbackAnnotation.getSimpleName() + "' in '"
					+ listenerClassDetails.getClassName() + "'"
					+ signatureRequirement( consumerType ) );
		}
		if ( callbackMethods.containsKey( callbackType ) ) {
			throw new ModelsException( "Duplicate callback method " + source + " '@"
					+ callbackAnnotation.getSimpleName() + "' in listener class '"
					+ listenerClassDetails.getClassName() + "'" );
		}
		callbackMethods.put( callbackType, methodDetails );
	}

	private static String signatureRequirement(JpaEventListenerStyle consumerType) {
		return switch ( consumerType ) {
			case CALLBACK -> " must return void and take no arguments";
			case LISTENER -> " must return void and take one argument";
		};

View on GitHub (pinned to fad1729dce)

Solutions

  1. Ensure the named callback method exists on the listener class with the required signature (void return, correct single parameter, accessible).

Example fix

Ensure the named callback method exists on the listener class with the required signature (void return, correct single parameter, accessible).

When it happens

Trigger: A JPA entity-listener or lifecycle callback violates the callback contract.

Common situations: Listener classes with missing lifecycle annotations, wrong method signatures, or multiple methods for the same event type.


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