Breaking change

Hi Allard,

It seems your latest snapshot build introduced something not quite backward compatible. Our saga event handlers currently throws the following exception when handling events:

2012-10-10 12:52:19,289 [SimpleAsyncTaskExecutor-1] ERROR com.casumo.platform.event.infrastructure.BackOffErrorHandler - Error when handling event
org.springframework.amqp.rabbit.listener.ListenerExecutionFailedException: Listener threw exception
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(
---- Debugging information ----
field : default
class : org.axonframework.saga.annotation.AssociationValuesImpl
required-type : org.axonframework.saga.annotation.AssociationValuesImpl
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /com.casumo.platform.components.bonus.command.sagas.DepositBonusSaga/associationValues/org.axonframework.saga.annotation.AssociationValuesImpl/default
line number : 1
class[1] : com.casumo.platform.components.bonus.command.sagas.DepositBonusSaga
version : null

Hi Sebastian,

I made some changes to the implementation of the AssociationValuesImpl class. I didn’t expect them to be backwards incompatible, but it seems they are.
The previous version of the class used some Java Serialization API methods (readObject and writeObject), but didn’t really do special things in them, other than initialization of some transient fields. XStream adds a default element to the serialized output to tell the deserializer that a “input.defaultReadObject” will be invoked.
In the new version, this element is not necessary anymore. A quick fix could be to remove the element from the “org.axonframework.saga.annotation.AssociationValuesImpl” element in your serialized Sagas.

If you have no clue what I mean, send me a serialized Saga instance. I can then mark the components that need to be removed.



I realized that I still had old and new style serialized Sagas in my local database. Here is the old format:


… removed content…

And this is the new format:

As you can see, two levels of elements have been removed, as well as the serialization=“custom” attribute.



I have a clue what you mean and there seems to be a few other differences as well. Below is an example of one of our serialized sagas together with an xstream serialized saga from the new version. Changes marked in red (newlines added for readability).

As I see it a simple search and replace removing the marked stuff. Would you agree? Can you see any other problems?









Looks like removing the red stuff will get you back on the road.
Sorry for pushing incompatible changes down your throat. Good news it that the new code performs much better.


: )

Once again we are back on the latest snapshot build of axon in production : ).

For any one else interested, this script did the trick for us (MySQL)

use casumo_command;

create table SagaEntry2 like SagaEntry;
insert SagaEntry2 select * from SagaEntry;

update SagaEntry2 set serializedSaga = replace(serializedSaga, ’ serialization=“custom”’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ‘<org.axonframework.saga.annotation.AssociationValuesImpl>’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ‘’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ’ class=“sorted-set”’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ‘’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ‘’, ‘’);
update SagaEntry2 set serializedSaga = replace(serializedSaga, ‘</org.axonframework.saga.annotation.AssociationValuesImpl>’, ‘’);

rename table SagaEntry to SagaEntry_old;
rename table SagaEntry2 to SagaEntry;


You should probably check that none of the replaced terns are part of your actual saga instances as well…