{"record":{"id":"9f55eca03508e7d7","repo":"hibernate/hibernate-orm","slug":"mapping-for-entity-listener-s-specified-no-call","errorCode":null,"errorMessage":"Mapping for entity listener '%s' specified no callback methods","messagePattern":"Mapping for entity listener '(.+?)' specified no callback methods","errorType":"exception","errorClass":"ModelsException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/models/spi/LifecycleEventHandler.java","lineNumber":289,"sourceCode":"\t\t\t\t\t\tmethodDetails,\n\t\t\t\t\t\tcallbackMethods ) ) {\n\t\t\tmutableMethodDetails.addAnnotationUsage( annotationDescriptor.createUsage( modelsContext ) );\n\t\t}\n\t}\n\n\tprivate static boolean isImplicitMethodMappings(JaxbEntityListenerImpl jaxbMapping) {\n\t\treturn jaxbMapping.getPrePersist() == null\n\t\t\t&& jaxbMapping.getPreUpdate() == null\n\t\t\t&& jaxbMapping.getPreRemove() == null\n\t\t\t&& jaxbMapping.getPostLoad() == null\n\t\t\t&& jaxbMapping.getPostPersist() == null\n\t\t\t&& jaxbMapping.getPostUpdate() == null\n\t\t\t&& jaxbMapping.getPostRemove() == null;\n\t}\n\n\tprivate static void errorIfEmpty(LifecycleEventHandler descriptor) {\n\t\tif ( !descriptor.hasCallbackMethods() ) {\n\t\t\tthrow new ModelsException( \"Mapping for entity listener '\"\n\t\t\t\t\t\t\t\t\t\t+ descriptor.listenerClass.getClassName()\n\t\t\t\t\t\t\t\t\t\t+ \"' specified no callback methods\" );\n\t\t}\n\t}\n\n\t/// Create a handler from annotations based on annotated methods on the given `listenerClassDetails`.\n\t/// Used from XML parsing when no explicit methods are identified indicating that we should use\n\t/// whatever event annotations are available, and errror if none are found.\n\tprivate static LifecycleEventHandler from(JpaEventListenerStyle consumerType, ClassDetails listenerClassDetails) {\n\t\treturn from( consumerType, listenerClassDetails, true );\n\t}\n\n\t/// Create a handler from annotations based on annotated methods on the given `listenerClassDetails`.\n\tpublic static LifecycleEventHandler from(\n\t\t\tJpaEventListenerStyle consumerType,\n\t\t\tClassDetails listenerClassDetails,\n\t\t\tboolean errorIfEmpty) {\n\t\tfinal EnumMap<CallbackType, MethodDetails> callbackMethods = new EnumMap<>( CallbackType.class );","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/models/spi/LifecycleEventHandler.java#L271-L307","documentation":"Error \"Mapping for entity listener '%s' specified no callback methods\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A JPA entity-listener or lifecycle callback violates the callback contract.","commonSituations":"Listener classes with missing lifecycle annotations, wrong method signatures, or multiple methods for the same event type.","solutions":["Annotate at least one method of the entity listener with a lifecycle annotation (@PrePersist, @PostLoad, etc.) or remove the listener registration."],"exampleFix":"Annotate at least one method of the entity listener with a lifecycle annotation (@PrePersist, @PostLoad, etc.) or remove the listener registration.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}