Cannot find serializer for value 'ObjectValue [value=null'

Hi All,
I am tring to train myself using ExternalClienteEngine to interacting with standalone BPM engine started using SpringBootContainer.

Following the pom of BPM engine:
pom.xml (4.6 KB)

This is the workflow deplayed and activated by web application
archiver.bpmn (7.2 KB)

The BMP Rest Engine fail with 500 error:

2020-05-05 13:00:51.834 WARN 3796 — [nio-8080-exec-6] org.camunda.bpm.engine.rest.exception : ENGINE-REST-HTTP500 org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value ‘ObjectValue [value=null, isDeserialized=false, serializationDataFormat=application/xml, objectTypeName=org.camunda.bpm.getstarted.chargecard.Invoice, serializedValue=78 chars, isTransient=false]’.
at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:88)

The task in managed by the following

	client.subscribe("invoiceCreator")
	      .handler((externalTask, externalTaskService) -> {

	        // instantiate an invoice object
	        Invoice invoice = new Invoice("A123");

	        // create an object typed variable with the serialization format XML
	        ObjectValue invoiceValue = ClientValues
	          .objectValue(invoice)
	          //.serializationDataFormat("application/xml")
	          .serializationDataFormat("application/xml")
	          .create();

	        // add the invoice object and its id to a map
	        Map<String, Object> variables = new HashMap<>();
	        variables.put("invoiceId", invoice.id);
	        variables.put("invoice", invoiceValue);

	        // select the scope of the variables
	        boolean isRandomSample = Math.random() <= 0.5;
	        if (isRandomSample) {
	          externalTaskService.complete(externalTask, variables);
	        } else {
	          externalTaskService.complete(externalTask, null, variables);
	        }

	        LOGGER.info("The External Task " + externalTask.getId() +
	          " has been completed!");

	      }).open();

Thanks to all can help me.
Olindo

Can you share a bit more in regard to your external client java code? I was kinda surprised to see org.camunda.bpm.getstarted.chargecard.Invoice (but I’ll just assume you changed the example up some).

Just a hunch based on some digging of my own, you may need to add dependencies in the engine pom.xml for Spin so that data gets serialized properly (see here).

1 Like

You are missing the SPIN dependencies. They contain the Serializer(s) missing here.
Here is an example POM:

It is recommended to include the BOM in the dependency management section and let the specific SPIN dependency versions be driven by the BOM of the Camunda version in use.

Thanks to all
I updated pom of engine here the file pom.xml (5.3 KB)

but the error is the same:

2020-05-06 11:22:56.671 ERROR 17300 — [nio-8080-exec-6] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: Cannot find serializer for value ‘ObjectValue [value=null, isDeserialized=false, serializationDataFormat=application/xml, objectTypeName=org.camunda.bpm.getstarted.chargecard.Invoice, serializedValue=78 chars, isTransient=false]’.

org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value ‘ObjectValue [value=null, isDeserialized=false, serializationDataFormat=application/xml, objectTypeName=org.camunda.bpm.getstarted.chargecard.Invoice, serializedValue=78 chars, isTransient=false]’.
at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:88) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.setValue(TypedValueField.java:113) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.(VariableInstanceEntity.java:127) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:146) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:31) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:25) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocal(AbstractVariableScope.java:369) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:342) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:335) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:335) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:310) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariables(AbstractVariableScope.java:257) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity.complete(ExternalTaskEntity.java:350) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CompleteExternalTaskCmd.execute(CompleteExternalTaskCmd.java:45) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.cmd.HandleExternalTaskCmd.execute(HandleExternalTaskCmd.java:59) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.cmd.HandleExternalTaskCmd.execute(HandleExternalTaskCmd.java:31) ~[camunda-engine-7.12.0.jar:7.12.0]

a doubt: org.camunda.bpm.getstarted.chargecard.Invoice must be deployend in BPM engine too?

Regards
Olindo

RESOLVED spin plugin was missing!
Thanks to all

1 Like

Yes it’s a Frankeinst Moster assembled by me