'Command' resulted in com.thoughtworks.xstream.io.StreamException()

Hi I have this error when try to sendingCommand using commandGateway ,

‘Command’ resulted in com.thoughtworks.xstream.io.StreamException()

please help


Can you please provide a stacktrace (including the error message) and the actual command you are trying to send?

Best regards,


Hi Nils ,

Here is my upcaster :

public class MyClassupcaster extends SingleEventUpcaster {
private static final String ABSENCE_DAYS = “absenceDays”;
private static final String UPDATED_BALANCE = “updatedBalance”;

private static final SimpleSerializedType TARGET_TYPE =
new SimpleSerializedType(MyEventExample.class.getTypeName(), “1.0”);

protected boolean canUpcast(IntermediateEventRepresentation intermediateEventRepresentation) {
return intermediateEventRepresentation.getType().equals(TARGET_TYPE);

protected IntermediateEventRepresentation doUpcast(
IntermediateEventRepresentation intermediateEventRepresentation) {
return intermediateEventRepresentation.upcastPayload(
new SimpleSerializedType(TARGET_TYPE.getName(), “2.0”),
document → {
List content = document.getRootElement().content();
for (Node node : content) {
Element element = (DefaultElement) node;
if (node.getName().equals(ABSENCE_DAYS)) {
BigDecimal absenceDays = new BigDecimal(node.getText());

        if (node.getName().equals(UPDATED_BALANCE)) {
          BigDecimal takenDays = new BigDecimal(element.element("takenDays").getText());
          BigDecimal entitlementDays =
              new BigDecimal(element.element("entitlementDays").getText());
          BigDecimal plannedDays = new BigDecimal(element.element("plannedDays").getText());
          BigDecimal sickLeaveDays = new BigDecimal(element.element("sickLeaveDays").getText());
          BigDecimal pendingDays = new BigDecimal(element.element("pendingDays").getText());
          BigDecimal ptoDays = new BigDecimal(element.element("ptoDays").getText());

      return document;


I have changed the type of the field at my event and wanted to upcast the field from integer to bigdecimal , but this error always comes up :

org.axonframework.serialization.CannotConvertBetweenTypesException: Cannot build a converter to convert from [B to org.dom4j.tree.DefaultDocument
	at org.axonframework.serialization.ChainedConverter.calculateChain(ChainedConverter.java:59) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.serialization.ChainingConverter.convert(ChainingConverter.java:95) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.serialization.Converter.convert(Converter.java:71) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.serialization.upcasting.event.UpcastedEventRepresentation.getData(UpcastedEventRepresentation.java:92) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.serialization.LazyDeserializingObject.getObject(LazyDeserializingObject.java:102) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.serialization.SerializedMessage.getPayload(SerializedMessage.java:77) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.messaging.MessageDecorator.getPayload(MessageDecorator.java:56) ~[axon-messaging-4.5.10.jar!/:4.5.10]
	at org.axonframework.messaging.annotation.PayloadParameterResolver.resolveParameterValue(PayloadParameterResolver.java:41) ~[axon-messaging-4.5.10.jar!/:4.5.10]


I am confused. I though your issue was about a command not being sendable? What has this to do with the upcaster?

Best regards



Apart from that: Converting a byte array into a Dom4J instance should be a quite easy route for Axon: ByteArrayToInputStreamConverter + InputStreamToDom4jConverter. The latter is registered by the XStreamSerializer. So my first thought would be a misconfiguration, e.g. configuring Jackson as Serialization format and then still using (the XML based) org.dom4j.Document.

Best regards


Sorry for confusion the first problem was with command and it’s only happened when I hit the endpoint using postman, I tried different way to test using integration test and then the upcaster problem appeared the good things was I solved it to change Jackson to XStream because my axon event sourcing table by default using XStream format while my events using jacksonized and you’re right, Thank you so much!

which version of the Framework are you using?

In Axon Framework version 4.5.X introduced a bit of change in the Serializer. I expect that your configuration for the generalSerializer is not in place.
Can you share it?
Is this a previously running application or a new one?

I leave you two code snippet that maybe will help to solve your issue
First, let’s create a configuration for the generalSerializer

public class SerializerConfiguration {

    public Serializer generalSerializer(XStream xStream) {
        return XStreamSerializer.builder()

And then let’s configure it in the application.yml for your axonframework client application

    general: xstream
    messages: jackson
    events: jackson

In my configuration snippet, I also configure jackson as a serializer for messages and events.