Cannot serialize object - SPIN/DOM-XML-01030 Cannot create context

Hy Guys,

we have a weird situation with an “Inline Script” on a Service Task and we are stuck on ideas…

The Task calls a REST-API and the result is stored to a local variable. In the Inline Script, we want to parse one part of the variable into JSON and store it into another variable.
On the Test-Environment everything works as expected, but on the Training-Environment we get the following error:

ENGINE-16004 Exception while closing command context: Cannot serialize object in variable ‘geaenderteVorhaben’: SPIN/DOM-XML-01030 Cannot create context

The result of the REST-Call looks as follows:

{"data":[{"iaMassnahmeId":null,"fipsyId":10028319},{"iaMassnahmeId":null,"fipsyId":10028348}]}

We want to JSON.parse the data-property.

Here’s the code of the Inline-Script:

try {
  var log = java.util.logging.Logger.getLogger("");
  log.info("Start InlineScript");

  var resp = execution.getVariable("mnFipsyGeaenderteVorhabenLesen");

  if (resp !== null && resp !== undefined) {
    var json = JSON.parse(resp);
    
    if (json.data && json.data.length > 0) {
      if (json.errors) {
        log.info(json.errors);
        ""
      }
      else {
        log.info("Data: "+json.data);
        json.data
      }
    }
    else {
      log.info("NO Data");
      ""
    }
  }
  else {
    log.info("NULL or UNDEFINED");
    ""
  }
}
catch (err) {
  log.info(err);
}

On the Test-Environment the result in the cockpit looks as follows:

Do you have any ideas why the same code is working on Test- but not on Training-Environment?
On both environments the models are completely the same and the Java-Version is “Version 8 Update 241”.

Thx in advance.

BR,
Manuel