My java version 17 and axon 4.5.3
This is my controller.
buildOrder = orderService.buildOrder(orderDto.getCartCode(),token);
CreateOrderCommand createOrderCommand
= CreateOrderCommand.builder()
.cartCode(orderDto.getCartCode())
.orderStatus("CREATED")
.orderCode(buildOrder.getOrderCode())
.order(buildOrder)
.build();
commandGateway.sendAndWait(createOrderCommand);
Here I'm building my order object and passing to gateway. But it returns com.thoughtworks.xstream.converters.ConversionException: No converter available Is there any solution?
I tried by setting these properties in properties file axon: serializer: general: jackson events: jackson messages: jackson
The exception is from XStream, which is unable to (de)serialize your object. Given your using an Axon release that's over 2 years old, it is not unlikely that the version of XStream that your transitively receiving is unable to deal with some of the Java 17 constructs. I would suggest updating to a more recent version of Axon (why not the last one: 4.9.1?) to see if that resolves the issue.
Note that by setting
axon.serializer.messages=jackson, the Spring Boot autoconfiguration will configure a Jackson Serializer for your messages, rather than XStream. With that setting, you should not get this exception at all.