Class EntityMissingAfterFirstEventException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.eventsourcing.EntityMissingAfterFirstEventException
All Implemented Interfaces:
Serializable

public class EntityMissingAfterFirstEventException extends RuntimeException
Exception thrown by the EventSourcedEntityFactory when the entity returned by
invalid reference
EventSourcedEntityFactory#create(Object, EventMessage)
is null when calling it with a non-null firstEventMessage during the EventSourcingRepository.load(Object, ProcessingContext) or EventSourcingRepository.loadOrCreate(Object, ProcessingContext).

Returning a null entity in this case indicates that the factory is incapable of creating an entity when provided an EventMessage, which violates the contract of the EventSourcedEntityFactory.

Ensure that the factory is capable of creating an entity when provided with an event message.

Since:
5.0.0
Author:
Mitchell Herrijgers
See Also:
  • Constructor Details

    • EntityMissingAfterFirstEventException

      public EntityMissingAfterFirstEventException(Object identifier)
      Constructs the exception with the given identifier.
      Parameters:
      identifier - The identifier of the entity that was attempted to be loaded or created.