JiBX
  1. JiBX
  2. JIBX-43

java.lang.IllegalStateException: Internal error - content not ordered

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta3c
    • Fix Version/s: 1.0-RC0
    • Component/s: core
    • Labels:
      None
    • Environment:
      Verified on both Linux and Windows, using jdk 1.4.2
    • Number of attachments :
      1

      Description

      The following (simplified) bindings file is causing an "Internal error":

      <binding>
      <mapping name="top" class="Top">
      <structure name="level2" ordered="false">
      <collection item-type="Level3" set-method="setLevel3" get-method="getLevel3" usage="optional" />
      </structure>
      </mapping>

      <mapping name="level3" class="Level3" value-style="attribute">
      <value name="name" field="name" />
      </mapping>
      </binding>

      The error disappears if the "collection" element is removed, or if the "ordered='false'" clause is remove from the structure. Although it's obviously meaningless to set "ordered='false'" for a single-element structure, it took us quite a while to track this issue down, since the error message is misleading.

        Activity

        Hide
        Joshua Davies added a comment -

        Here's the full stack trace we get:

        java.lang.IllegalStateException: Internal error - content not ordered
        at org.jibx.binding.def.NestedBase.genContentPresentTest(NestedBase.java:174)
        at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassT
        hroughComponent.java:106)
        at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassT
        hroughComponent.java:106)
        at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:166)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272)
        at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:150)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:611)
        at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:723)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272)
        at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:498)
        at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:600)
        at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:555)
        at org.jibx.binding.Compile.compile(Compile.java:299)
        at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:238)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

        Show
        Joshua Davies added a comment - Here's the full stack trace we get: java.lang.IllegalStateException: Internal error - content not ordered at org.jibx.binding.def.NestedBase.genContentPresentTest(NestedBase.java:174) at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassT hroughComponent.java:106) at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassT hroughComponent.java:106) at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:166) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272) at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:150) at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:611) at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:723) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:272) at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:498) at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:600) at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:555) at org.jibx.binding.Compile.compile(Compile.java:299) at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:238) at org.apache.tools.ant.Task.perform(Task.java:319) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.Project.executeTargets(Project.java:1250) at org.apache.tools.ant.Main.runBuild(Main.java:610) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235)
        Hide
        Joshua Davies added a comment -

        Here's a full tarball that illustrates the issue. Just untar the attached file, modify the "jibx.home" property in build.xml, run "ant bind" and you should get the same stack trace.

        Show
        Joshua Davies added a comment - Here's a full tarball that illustrates the issue. Just untar the attached file, modify the "jibx.home" property in build.xml, run "ant bind" and you should get the same stack trace.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Joshua Davies
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: