Hi there,
I am new to axon and am helping to implement an inventory management system. We have a proof of concept setup with event sourced aggregates. Creating new aggregates with an initial state appears to work. When we try to post a ‘correction’ to an exisiting aggregate then things seems to fall apart. I have posted the error below:
17:55:26,683 WARN [org.axonframework.eventsourcing.eventstore.EmbeddedEventStore] (RMI TCP Connection(24)-192.168.56.1) Error reading snapshot. Reconstructing aggregate from entire event stream. Caused by: java.lang.NullPointerException null
17:55:26,689 WARN [org.axonframework.commandhandling.callbacks.LoggingCallback] (RMI TCP Connection(24)-192.168.56.1) Command resulted in exception: com.owfg.sim.pim.axon.prototype2.commandside.inventorydocument.commands.CorrectInventoryDocumentCommand: java.lang.NullPointerException
at org.axonframework.eventsourcing.eventstore.jpa.JpaEventStorageEngine.fetchDomainEvents(JpaEventStorageEngine.java:180)
The error seems to indicate that it checks if there is a snapshot for this existing aggregate root first and then attempts to reconstruct it using its previously committed events. Since we have no snapshots then it would make sense it would go right to the event stream. The events for this aggregate root do exist and I am certain that I am using the correct UUID to obtain a ‘handle’ to it.
Meta Data associated with single event tied to the aggregate root:
traceId2662b8dd-19fc-4772-9ce8-fcdc6400214dcorrelationId2662b8dd-19fc-4772-9ce8-fcdc6400214d
Payload(sanitized):
<…axon.prototype2.commandside.inventorydocument.events.InventoryDocumentPostedEvent>e48f19e0-6fdf-4b04-b4c0-34e01d67dc2bTEST_LOCATIONTEST_TYPE1691168<…poc.inventorydocument.InventoryChange>21499299961714000000INVENTORY_ADDED…
.
. //business specific state information removed
.
</…axon.prototype2.commandside.inventorydocument.events.InventoryDocumentPostedEvent>
I have bolded the aggregate identifier in the payload. Has anyone encountered something like this? Additionally, I can provide more information wrt our axon setup, but I am unsure where to start and do not want to bog down this post with unnecessary detail. If, however, something is requested then I would be more than happy to post it.
Thank you in advance,
Justin.