2 Replies Latest reply on May 21, 2017 3:57 PM by Frank Langelage

    Different serialization of subsystem properties on Wildfly 8/10 and 11

    Frank Langelage Master

      Recently I tried out current Wildfly master / Wildfly 11.0.0-Beta-SNAPSHOT together with Camunda BPM engine.

      Camunda offers a subsystem to be used on Wildfly 8 and 10. The code of the module is identical for both versions.

      Using this module on Wildlfy 11 works on first startup, but after shutdown follwing startup fails.

      This is because some elements of this subsystem are written to standalone-full.xml not like they are expected.

      The schema of the subsystem can be found here: camunda-bpm-platform/foxEngineSubsystem_1_1.xsd at master · camunda/camunda-bpm-platform · GitHub

      The related java code at camunda-bpm-platform/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss at master · camunda/cam… .

       

      Initially property elements have a name and a text-element child like you can see here:

      <property name="lockTimeInMillis">300000</property>
      <property name="waitTimeInMillis">5000</property>
      <property name="maxJobsPerAcquisition">3</property>

       

      Afterwards these information are serialized this way:

      <property name="lockTimeInMillis" value="300000"/>
      <property name="waitTimeInMillis" value="5000"/>
      <property name="maxJobsPerAcquisition" value="3"/>
      
      
      

      We have value property for each element instead of a text child.

       

      As already said, the module is exactly the same, only the runtime environment changed. Identical jar's on Wildfly 10 and 11.

      Is this by intention? How can I influence this?

        • 1. Re: Different serialization of subsystem properties on Wildfly 8/10 and 11
          Tomaz Cerar Master

          Looking at the code of perister (writer) it looks bit fishy.

          but main difference is in the way attribute is defined.

           

          If i am reading correctly (only via github) you have properties defined camunda-bpm-platform/SubsystemAttributeDefinitons.java at master · camunda/camunda-bpm-platform · GitHub

          this should be PropertiesAttributeDefinition instead.

           

          Btw, did you maybe consider moving parser to PersistentResourceXMLParser/PersistentResourceXMLDescription API? It would make it much more consistent

          • 2. Re: Different serialization of subsystem properties on Wildfly 8/10 and 11
            Frank Langelage Master

            Thomaz, thanks for your response. I tried your tip.

            But with this change

            diff --git a/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/extension/SubsystemAttributeDefinitons.java b/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/extension/SubsystemAttributeDefinitons.java
            index 4c03590fed..c927817955 100644
            --- a/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/extension/SubsystemAttributeDefinitons.java
            +++ b/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/extension/SubsystemAttributeDefinitons.java
            @@ -23,7 +23,7 @@ public class SubsystemAttributeDefinitons {
            
               // general
               public static final SimpleAttributeDefinition NAME = new SimpleAttributeDefinition(ModelConstants.NAME, new ModelNode("default"), ModelType.STRING, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
            -  public static final SimpleMapAttributeDefinition PROPERTIES = new SimpleMapAttributeDefinition.Builder(ModelConstants.PROPERTIES, true).setRestartAllServices().build();
            +  public static final PropertiesAttributeDefinition PROPERTIES = new PropertiesAttributeDefinition.Builder(ModelConstants.PROPERTIES, true).setXmlName(ModelConstants.PROPERTY).setRestartAllServices().build();
            
               // process engine
               public static final SimpleAttributeDefinition DEFAULT = new SimpleAttributeDefinition(ModelConstants.DEFAULT, new ModelNode(false), ModelType.BOOLEAN, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
            

            properties get serialized in this form now <property name="lockTimeInMillis" value="300000"/> which breaks the testsuite. Because this expects this form: <property name="lockTimeInMillis">300000</property>.

            The Camunda build is using Wildfly 8.

            I can change the test, that they expect the new form, which probably will work with Wildfly 8, 10 and 11 then.

            But my initial question was, can I change the way of serialization to the previous for when running this software on Wildfly 11.

             

            As I'm not the owner of this project, just a volunteer contributor in certain areas, a complete rewrite of the parser is a too big task as it seems to me.