Cannot deserialize from object value (no delegate- or property-based creator)

I get the below error when using Asynchronous Continuation BEFORE.
OrderResponse is the object .(In actual object is much more complex and and has many fields)

cannot deserialize from object value (no delegate- or property-based creator)

But when i use Asynchronous Continuation After . i dont get the error.

@Component
 public class MessageEndEvent implements JavaDelegate{
@Override
public void execute(DelegateExecution execution) throws Exception {
			
	OrderResponse  orderObj  =  (OrderResponse) execution.getVariable("orderObj"); //does not serialise
	
	System.out.println(" MessageEndEvent val " + orderObj.getMessage());



 public class OrderResponse {

private int orderId;

private String message;

private Map<String,String> str;



public OrderResponse(int orderId, String message, Map<String, String> str) {
	super();
	this.orderId = orderId;
	this.message = message;
	this.str = str;
}

Hi,

This error is probably produced by the deserialization via Jackson.

A quick search brought me to stackoverflow. Can you try the following steps?

  1. Add a constructor (without paramaters) to your OrderResponse class
  2. Add getter and setters to the class

If this does not work, follow the link above and annotate the parameters of your existing constructor.

Without asynchronous before, it works because the data has not been persisted yet Camunda can access the object (without deserialization).

Hi ,
For above example adding NO ARG will solve it.BUt not for my actual object which is much more complex and i wont be able to modify it
it didn’t work.I am suing below in my code.Plus My actual code Object is much more complex and has nested Object . eg . private Map<Customer,String> str; Customer has

@AllArgsConstructor(onConstructor_ = {@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)})
@Builder
@Data

This error is probably produced by the deserialization via Jackson. How to deserialise via Camunda spin jar?

For more transparency, I’d prefer explicit serialization and deserialization with SPIN:

Note, Camunda Spin uses Jackson.

I am serialisasing as json and setting the value in execution.setVariable/how can i set it uing SPIN

ObjectValue objectValue = Variables.objectValue(myJavaObject)
.serializationDataFormat(Variables.SerializationDataFormats.JSON)
.create();

This is the correct way of using SPIN.

But i am get the desialisation error whileading the values from execution.getVar… when using CONTINUATION ASYNC BEFORE

Given the limited information, it is rather difficult to debug. Here are some questions that may help:

  • Have you checked, via API or in the database, whether the object has been serialized correctly?
  • Have you tried to serialize/deserialize such objects using Spin/Jackson outside the engine?
  • In your first post, you wrote that you get the error only when using asynchronous continuation before, but in your last post, you said you get it when using asynchronous continuation after. Which is it?

continuation before .AFter was typo in the last post .How to check in camunda databse to see if object is serialised correctly?

The database has a table called ACT_RU_VARIABLE, which stores the variables of all running processes. You can run a query against this table to find the variable:

You can also access the variable via the api:

1 Like

Resolved the issue by adding
@JsonDeserialize(builder = MyClass.MyClassBuilder.class) and JsonProperty annotation

1 Like