I have a projet spring boot with jdk 17, kotlin, mongodb and axon(v 4.6.0) without axon server
this is the config class: MongoAutoConfig/MongoConfig.kt at main · akanzari/MongoAutoConfig · GitHub
this is the serialization config class: MongoAutoConfig/JsonSerializationConfig.kt at main · akanzari/MongoAutoConfig · GitHub
application.yml
axon:
serializer:
general: jackson
events: jackson
messages: jackson
When i start the projet i get these errors
org.axonframework.common.AxonConfigurationException: A default XStreamSerializer is used for snapshots, without specifying the security context
org.axonframework.common.AxonConfigurationException: A default XStreamSerializer is used for events, without specifying the security context
Can you share the entire stack trace with us, @Aymen_Kanzari?
The stack trace will show who’s sharing the predicament around the XStreamSerializer
.
Thus, it’ll allow us to help you to the exact point, instead of guessing.
Thanks, that greatly helps, @Aymen_Kanzari.
The issue you’re hitting is that the Mongo Extension has no auto-configuration in place.
As such, it isn’t Axon Framework that constructs the MongoEventStorageEngine
(where your exception originates).
Instead, that would be your application configuration.
So, the predicament lies with your MongoConfig
.
You’re just making a basic MongoEventStorageEngine
.
Setting the serializers
in your application.properties
to jackson
simply cannot impact this.
So, what you should do, is invoke the snapshotSerializer(Serializer)
and eventSerializer(Serializer)
methods when constructing the MongoEventStorageEngine
.