Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-13148

How can I store a complex type in Java? Using JSON Spin, get error 'Cannot find serializer for value null'

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • L3 - Default
    • None
    • None
    • engine
    • None

    Description

      Environment (Required on creation):

      Java tomcat

       

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

       

      Basically what I am trying to do is store a complex type (containing like 6 name, value pairs) in a variable in the database and retrieve them later.

       

      I'm trying to write a JSON object as a string into a SpinValue and getting an error when setting the variable.

      Here's my code:

      ==============================================
      String json = "{\"name\" : \"jonny\","
      + "\"address\" :

      {" + "\"street\" : \"12 High Street\"," + "\"post code\" : 1234" + "}

      "
      + "}";

      JsonValue jsonValue = SpinValues.jsonValue(json).create();

      execution.setVariable("customerJonny", jsonValue);

      =============================================

       

      It throws this exception:

      org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'Value 'null' of type 'json', isTransient=false'.org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'Value 'null' of type 'json', isTransient=false'. 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) at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:25) at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocal(AbstractVariableScope.java:369) at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:342) at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:335) at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:310) at jpl.cws.engine.CwsEngineProcessApplication$2.notify(CwsEngineProcessApplication.java:442)

       

      Steps to reproduce (Required on creation):

      Observed Behavior (Required on creation):

      Expected behavior (Required on creation):

      Root Cause (Required on prioritization):

      Solution Ideas (Optional):

      Hints (Optional):

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              tobias.metzke Tobias Metzke-Bernstein
              jamesfwood James Wood
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce