Aggregate identifier is null Axon 3.0.6

  • Getting these warnings logs: “An attempt to create and store a snapshot resulted in an exception. Exception summary: Aggregate identifier must be non-null after applying an event. Make sure the aggregate identifier is initialized at the latest when handling the creation event.”
  • We use a Jackson serializer for the event store
  • error occurs when a new snapshot is being created
  • we see 8 of these errors but only 2 new events persist, thinking retry logic or something

Hi Katelyn,

With Jackson, especially for aggregates, special care needs to be taken to make sure all the fields that need to be serialized, are indeed serialized. One of those ways is to add a public getter for each of those fields, like the aggregate identifier.

It’s very likely currently stored without the aggregate identifier. Other fields might be missing as well. It’s also possible to set the visibility on the object mapper objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);