# Error - Cannot find serialize for value 'ObjectValue from jUnit

**URL:** <https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [September 7, 2020, 11:43am UTC](https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378 "2020-09-07T11:43:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dineshsb](https://forum.camunda.io/letter_avatar_proxy/v4/letter/d/65b543/32.png) [@dineshsb](https://forum.camunda.io/u/dineshsb)\
**Post date:** [September 7, 2020, 11:43am UTC](https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378/1 "2020-09-07T11:43:05Z")

</div>

Hello All,

Env:- Camunda Spring boot 7.13

I have the below code in java delegate called from the “service task”. The work flow runs fine when invoked but the javadelagate gives the "org.camunda.bpm.engine.ProcessEngineException: **Cannot find serializer for value 'ObjectValue" when it gets invoked from the Junit**.

![image](https://forum.camunda.io/uploads/default/original/2X/d/db07b45498e7983a33d972907c62e16c81bd45a0.png)

```
 @Component("GetItemData")
 public class GetItemData implements JavaDelegate {

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		String itemsList = "{\n" +
				" \"firstName\": \"John\",\n" +
				" \"lastName\" : \"doe\",\n" +
				" \"age\" : \"26\",\n" +
				" \"items\": [\n" +
				" {\n" +
				" \"value\" : \"iPhone\",\n" +
				" \"category\": \"mobile\"\n" +
				" },\n" +
				" {\n" +
				" \"value\" : \"Pixel\",\n" +
				" \"number\": \"mobile\"\n" +
				" }\n" +
				" ]\n" +
				"}";
		Spin itemDataJSON = JSON(itemsList);
		TypedValue typedTransientObjectValue = Variables.objectValue(itemDataJSON, true).serializationDataFormat(Variables.SerializationDataFormats.JSON).create();
		execution.setVariable("itemsData", typedTransientObjectValue);
	}
}

```

**Test Code**

```
@Test
@Deployment(resources = {"SampleFlow.bpmn", "process1"})
public void createSampleFlow() throws Exception {
    Mocks.register("GetItemData", new GetItemData());
    RuntimeService runtimeService = engine.getRuntimeService();
    HistoryService historyService = engine.getHistoryService();
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("SampleFlow", "ORDER-01");
    List<HistoricProcessInstance> processInstancesList = historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey("ORDER-01").list();
    assertEquals(processInstancesList.size(), 3);

}

```

When this code is run below is the exception i see

```
   org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'ObjectValue [value={"firstName": "John","lastName" : "doe","age": "26","items": [{"value" : "iPhone","category": "mobile"},{"value" : "Pixel","number": "mobile"}] }, isDeserialized=true, serializationDataFormat=application/json, objectTypeName=null, serializedValue=null, isTransient=true]'.
	at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:88)
	at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.setValue(TypedValueField.java:122)
	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.<init>(VariableInstanceEntity.java:129)
	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:148)
	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:31)

```

POM :-

```
       <properties>
    <camunda.spring-boot.version>7.13.0</camunda.spring-boot.version>
    <spring-boot.version>2.2.5.RELEASE</spring-boot.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>

    <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
        <version>${camunda.spring-boot.version}</version>
    </dependency>

    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-plugin-spin</artifactId>
        <version>${camunda.spring-boot.version}</version>
    </dependency>

    <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-dataformat-all</artifactId>
        <version>1.9.0</version>
    </dependency>

    <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
        <version>${camunda.spring-boot.version}</version>
    </dependency>

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

    <dependency>
        <groupId>org.camunda.bpm.assert</groupId>
        <artifactId>camunda-bpm-assert</artifactId>
        <version>7.0.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
        <version>7.13.0</version>
        <!-- <type>jar.sha256</type>-->
        <scope>test</scope>
    </dependency>

```

---

<div class="post-metadata">

**Author:** ![dineshsb](https://forum.camunda.io/letter_avatar_proxy/v4/letter/d/65b543/32.png) [@dineshsb](https://forum.camunda.io/u/dineshsb)\
**Post date:** [September 8, 2020, 6:00am UTC](https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378/2 "2020-09-08T06:00:08Z")

</div>

Hello All ,

Any inputs or suggestions on how to resolve this .

Thanks  
Dinesh

---

<div class="post-metadata">

**Author:** ![jangalinski](https://forum.camunda.io/user_avatar/forum.camunda.io/jangalinski/32/14154_2.png) [@jangalinski](https://forum.camunda.io/u/jangalinski)\
**Post date:** [September 8, 2020, 6:39am UTC](https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378/3 "2020-09-08T06:39:31Z")

</div>

When you use spin/json you manually have to register the spin-plugin on your in memory process engine …

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 12:37pm UTC](https://forum.camunda.io/t/error-cannot-find-serialize-for-value-objectvalue-from-junit/22378/4 "2024-01-30T12:37:28Z")

</div>

Closed on January 30, 2024, 12:37pm UTC


