SPIN with XML not working in 7.13

Hi all!

I can’t get the “Native XML Variable Value” on this page XML | docs.camunda.org to work.

When I follw the example as is I get:
org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'Value 'null ...

And when I add a “SpinXmlElement e = xmlValue.getValue();” before I set the variable to Camunda I get:

org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'Value '<?xml version="1.0" encoding="UTF-8"?><customer xmlns="http:\/\/camunda.org/example" name="Jonny">
  <address>
    <street>12 High Street</street>
    <postCode>1234</postCode>
  </address>
</customer>
' of type 'xml', isTransient=false'.
	at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:88) ~[camunda-engine-7.13.0.jar:7.13.0]

Additional Information:
I am in a User task, nit a delegate expression so I call:
runtimeService.setVariable(executionId, UNTERSCHRIFT_MITARBEITEREXTERN.getVariable(), xmlValue);

Maven artifacts:

<dependency>
    <groupId>org.camunda.bpm</groupId>
    <artifactId>camunda-bom</artifactId>
    <version>7.13.0</version>
    <scope>import</scope>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>org.camunda.spin</groupId>
    <artifactId>camunda-spin-bom</artifactId>
    <scope>import</scope>
    <type>pom</type>
    <version>1.9.0</version>
</dependency>
<dependency>
    <groupId>org.camunda.bpm.springboot</groupId>
    <artifactId>camunda-bpm-spring-boot-starter</artifactId>
    <version>7.13.0</version>
</dependency>
<dependency>
    <groupId>org.camunda.bpm</groupId>
    <artifactId>camunda-engine-cdi</artifactId>
</dependency>
<dependency>
    <groupId>org.camunda.bpm</groupId>
    <artifactId>camunda-engine-plugin-spin</artifactId>
    <version>7.13.0</version>
</dependency>
<dependency>
    <groupId>org.camunda.spin</groupId>
    <artifactId>camunda-spin-core</artifactId>
</dependency>
<dependency>
    <groupId>org.camunda.spin</groupId>
    <artifactId>camunda-spin-dataformat-xml-dom</artifactId>
</dependency>
<dependency>
    <groupId>org.camunda.spin</groupId>
    <artifactId>camunda-spin-dataformat-json-jackson</artifactId>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.datatype</groupId>
    <artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
<dependency>
    <groupId>org.camunda.template-engines</groupId>
    <artifactId>camunda-template-engines-freemarker</artifactId>
</dependency>

Thanks in advance!

I double-checkt this inside a DelegateExpression - as the example suggest - and I get EXACTLY the same resut. I think something might be broken… Is there someone who can give me directions to find an issue tracker?

Regards,
Christoph

Hi @Christoph_Wilhelms,

the error message implies that Spin is not correctly integrated into your project somehow.
If it were, the engine would be able to find a serializer for the XML value.

I actually just gave it a try with

That just worked as expected.

In your application log, do you see anything like

INFO 14460 --- [  restartedMain] org.camunda.spin : SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatProvider[name = application/xml]
INFO 14460 --- [  restartedMain] org.camunda.spin : SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider[name = application/json]
INFO 14460 --- [  restartedMain] org.camunda.spin : SPIN-01011 Discovered Spin data format configurator: class org.camunda.bpm.spring.boot.starter.spin.CamundaJacksonFormatConfiguratorJdk8[dataformat = org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat]
INFO 14460 --- [  restartedMain] org.camunda.spin : SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormat[name = application/xml]
INFO 14460 --- [  restartedMain] org.camunda.spin : SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat[name = application/json]

If you don’t, that most probably means that Spin is not registered in your Spring Boot app correctly.

Hope that helps troubleshooting here.

Best,
Tobias

Hi Tobias!

Thanks for your effort, but how to REGISTER spin in my Spring Boot App “correctly”… I did not find a hint how to do so.
Can you plese post a copy of your “vanilla” pom.xml here, for the only difference I see currently is, that I have the dependency to camunda-engine-cdi in addidtion…

To answer your question. No I do not see any of these in my log, which means you are right somehow… Only entries regarding spring are these:
2020-09-14 08:19:02.266 INFO 11568 — [ main] org.camunda.bpm.dmn.feel.scala : FEEL/SCALA-01001 Spin value mapper detected
2020-09-14 08:19:02.422 INFO 11568 — [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@13464828, org.camunda.spin.plugin.impl.feel.integration.SpinValueMapper@5c19baa5)), function-provider: org.camunda.bpm.dmn.feel.impl.scala.function.CustomFunctionTransformer@4a3d0a5e, configuration: Configuration(false)]

Regards,
Christoph

Here is the solution:
CamundaConfiiguration needed just one line:

configuration.getProcessEnginePlugins().add(new SpinProcessEnginePlugin());

Sorry for all the hazzle… INHO this should go to hte SPIN and SpringBoot documentation :-).