Hi
I’m new to axon and I’m having trouble setting up my project to use the JacksonSerializer.
I’m using jackson-datatype-jsr310 version 2.8.9 and axon version 3.0.5.
I’ve setup mongo as the event store engine and it works fine with the xml serializer (I can run a command and the event appears in the db).
When I try use the JacksonSerializer instead it fails with the following log:
o.a.c.g.DefaultCommandGateway : Command 'com.example.domain.contact.command.CreateContactCommand' resulted in org.axonframework.eventsourcing.eventstore.EventStoreException(An event for aggregate [daeca0e8-1eda-4ed4-b0c6-d491b510d1bf] at sequence [0] could not be persisted)
.
I’ve looked through a few posts related to the JacksonSerializer and it seems quite a lot of changes need to be made to make it work.
One of the things I found said that your events need to have a default constructor, which also means you need to add setters.
Axon recommends however to use immutable objects, so changing all the relevant classes to make them mutable just to make it work with JacksonSerializer doesn’t really make sense.
I’m not sure about everything that needs to be changed as I haven’t yet been able to make it work with JacksonSerializer.
Do people that really want to use json end up polluting their codebase to make it work?
Is there some documentation that lists all the changes you need to make to get JacksonSerializer to work?
I don’t get any stacktraces besides the log I pasted above so it’s kind of difficult to know which part of the application needs to change.
Sorry if I missed something obvious.
Brendan