I’m working to run Axon-trader sample using GWT & GWT-Platform but I get the error:
Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/users-context.xml]; nested exception is org.axonframework.eventsourcing.IncompatibleAggregateException: The aggregate [User] does not have a suitable constructor. See Javadoc of GenericEventSourcingRepository for more information.:
which version of Axon are you using? In Axon 1, you need a constructor with an “AggregateIdentifier” as parameter. In Axon 2, you need a no-arg constructor. The Axon Trader sample works with Axon 2. So if you’re using the trader as inspiration, while using Axon 1, you get exceptions.
In both versions of Axon, you can override this behavior by implementing the AggregateFactory interface, and providing that to the Repository that you’re using.
Hope this helps. Don’t hesitate to get in touch if you need more help.
I’m using the original sample code, so axon-2, withput any change in server side.
The original sample runs well. The error appears when using GWTP instead vertx-ui. GWTP needs then appl-context.xml configuration file shown in my first message. I’ve added appl-context.xml file and change web.xml. Those are the only changes I’ve made in server files.
So, the User costructor have a no-arg constuctor: protected User() {}
in that case, the error message doesn’t really make sense. The only thing I can think of is that somehow there are Axon 1 libraries on the classpath. The “AggregateIdentifier” that the error message is talking about doesn’t exist in Axon 2 anymore. Only Axon 1 code can generate that error message.