Start process through REST API with variable in Json Object


I’m trying to start a very simple camunda process with one service activity but that service activity is supposed to use a variable which is a structured object.

I wrote my code to expect my variable to be of type com.fasterxml.jackson.databind.node.ArrayNode.

ArrayNode hddVariable = (ArrayNode) execution.getVariable(Variable.HDD.getKey());

I would like to start my process instance with the Camunda REST API using jersey-client but I haven’t been able to have camunda unserialize my json array into an ArrayNode.

The variable I send is something like that :

"hdd" : { "type" : "Object", "value" : "[{\"mntpoint\":\"pv.01\",\"size\":1,\"ondisk\":\"sda\",\"grow\":true,\"volgroup\":{\"name\":\"rootvg\",\"logvols\":[{\"name\":\"rootlv\",\"mntpoint\":\"/\",\"fstype\":\"ext4\",\"size\":4608},{\"name\":\"homelv\",\"mntpoint\":\"/home\",\"fstype\":\"ext4\",\"size\":128},{\"name\":\"nrblv\",\"mntpoint\":\"/nrb\",\"fstype\":\"ext4\",\"size\":256},{\"name\":\"optlv\",\"mntpoint\":\"/opt\",\"fstype\":\"ext4\",\"size\":2048},{\"name\":\"softlv\",\"mntpoint\":\"/software\",\"fstype\":\"ext4\",\"size\":3072},{\"name\":\"tmplv\",\"mntpoint\":\"/tmp\",\"fstype\":\"ext4\",\"size\":1024},{\"name\":\"varlv\",\"mntpoint\":\"/var\",\"fstype\":\"ext4\",\"size\":2048},{\"name\":\"varloglv\",\"mntpoint\":\"/var/log\",\"fstype\":\"ext4\",\"size\":1024},{\"name\":\"varlogaudlv\",\"mntpoint\":\"/var/log/audit\",\"fstype\":\"ext4\",\"size\":4096},{\"name\":\"swaplv\",\"mntpoint\":\"swap\",\"fstype\":\"swap\",\"size\":8192}]} } ]", "valueInfo" : { "objectTypeName" : "com.fasterxml.jackson.databind.node.ArrayNode", "serializationDataFormat" : "JSON" } }

But I have :
Deserialization Error: Cannot deserialize object in variable 'hdd': SPIN-PLUGIN-01002 Fallback serializer cannot handle deserialized objects

How could I use ArrayNode in variables ?

1 Like

Hi @Eric_Cornely,

I think serializationDataFormat mus be application/json.


Whatever JSON or application/json. I have an exception while getting the variable content :

An error occured while generating kickstart files: org.camunda.bpm.engine.ProcessEngineException: Cannot deserialize object in variable 'hdd': SPIN/JACKSON-JSON-01006 Cannot deserialize '[{"mntpoin...' to java type '[simple type, class com.fasterxml.jackson.databind.node.ArrayNode]' at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.readValue( at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.readValue( at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.getTypedValue( at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.getTypedValue( at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.getValueFromVariableInstance( at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.getVariable( at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.getVariable( at be.nrb.o2.bpmn.ksgen.GenerateKickstart.buildKsgenMessage( at be.nrb.o2.bpmn.ksgen.GenerateKickstart.execute(

Please post the entire stack trace. This exception should have a root cause exception that provides more information.


@thorben, the full stacktrace is available on pastebin :

Which Camunda version do you use?

@thorben, we use 7.5.6-ee.

Hi @Eric_Cornely,

I think the problem is that in JSON that you posted “value” key inside “hdd” object has String value, not an array value. Please take a look here for array examples in JSON


Hi @aakhmerov,

The reason why I submit the array as a String is because when I submit it as an array :

"hdd" : { "type" : "Object", "value" : [ { "mntpoint" : "pv.01", "size" : 1, "ondisk" : "sda", "grow" : true, "volgroup" : { "name" : "rootvg", "logvols" : [ { "name" : "rootlv", "mntpoint" : "/", "fstype" : "ext4", "size" : 4608 }, { "name" : "homelv", "mntpoint" : "/home", "fstype" : "ext4", "size" : 128 }, { "name" : "nrblv", "mntpoint" : "/nrb", "fstype" : "ext4", "size" : 256 }, { "name" : "optlv", "mntpoint" : "/opt", "fstype" : "ext4", "size" : 2048 }, { "name" : "softlv", "mntpoint" : "/software", "fstype" : "ext4", "size" : 3072 }, { "name" : "tmplv", "mntpoint" : "/tmp", "fstype" : "ext4", "size" : 1024 }, { "name" : "varlv", "mntpoint" : "/var", "fstype" : "ext4", "size" : 2048 }, { "name" : "varloglv", "mntpoint" : "/var/log", "fstype" : "ext4", "size" : 1024 }, { "name" : "varlogaudlv", "mntpoint" : "/var/log/audit", "fstype" : "ext4", "size" : 4096 }, { "name" : "swaplv", "mntpoint" : "swap", "fstype" : "swap", "size" : 8192 } ] } } ], "valueInfo" : { "objectTypeName" : "com.fasterxml.jackson.databind.node.ArrayNode", "serializationDataFormat" : "application/json" } }

The exception tells me to send a String value: Must provide 'null' or String value for value of SerializableValue type 'Object'.
See the full stacktrace on pastbin



1 Like

Using it with a String is the correct way. I tried this code in a unit test and it works fine:

String serializedValue = "the long json String";
ObjectMapper objectMapper = new ObjectMapper();
ArrayNode arrayNode = objectMapper.readValue(serializedValue, javaType);

Could you

a) Provide simplified process application sources and exact steps to reproduce the problem?
or b) debug this and set a break point at JacksonJsonDataFormatMapper#mapInternalToJava and check what the parameters are (i.e. what is the JSON value), and if the classloader of ObjectMapper and ArrayNode are the same?


Hey @Eric_Cornely,

could you post your serialization and deserialization code here please. I think Must provide 'null' or String value for value of SerializableValue type 'Object'. refers not to field value, but to the whole object.


Ok I have setup a small project on github:

I have one single EJB that is supposed to log the content of a variable named “demo”.

In my code I expect that variable to be an ArrayNode so cast it directly but I never could start the process instance with a json array.

The class be.ecornely.StartProcess is a main that uses jersey-client to submit a new process instance.



Hi @Eric_Cornely,

yould you try with following patch? adjust_serialization.txt (1.6 KB)


It fails on the putPOJO:

Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.camunda.bpm.engine.impl.util.json.JSONArray and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) at com.fasterxml.jackson.databind.JsonMappingException.from( at com.fasterxml.jackson.databind.SerializerProvider.mappingException( at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem( at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty( at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize( at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue( at com.fasterxml.jackson.databind.ObjectMapper.writeValue( at com.fasterxml.jackson.core.base.GeneratorBase.writeObject( at com.fasterxml.jackson.databind.node.POJONode.serialize( at com.fasterxml.jackson.databind.node.ObjectNode.serialize( at com.fasterxml.jackson.databind.node.ObjectNode.serialize( at com.fasterxml.jackson.databind.node.ObjectNode.serialize( at com.fasterxml.jackson.databind.ser.std.SerializableSerializer.serialize( at com.fasterxml.jackson.databind.ser.std.SerializableSerializer.serialize( at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue( at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize( at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue( at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString( at be.ecornely.StartProcess.main(

@Eric_Cornely, did it work after merge of PR?


@aakhmerov, no, still the same exception. I was looking into the code on camunda’s github to find where it fails and I’m sure it has to be passes as a String.

Jackson will be used to read it as a tree then it is supposed to be mapped to the destination type… the problem is somehow because it is a ArrayNode and the destination type is ArrayNode …

Any other idea ?

Hi Eric,

I’ve not proof my solution. But the value you’ve via rest api isn’t typed “Object”, it’s from type “String”. So try this (without valueinfo)

“hdd” : {
“type” : “String”,
“value” : “[{“mntpoint”:“pv.01”,“size”:1,“ondisk”:}…blablabla… ]”


1 Like

Hi Eric & All,

I faced the similar issue. On form, before submit, I changed type to String and it worked.

    // set value in variable manager so that it can be sent to backend
    variableManager.variable('myObj').type = 'String';
    // variableManager.variableValue('myObj', JSON.stringify($scope.myObj));

--Alok Anand