JiBX
  1. JiBX
  2. JIBX-153

java.lang.IllegalStateException: Internal error: Expected ParagraphType on stack, found java.lang.Object

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.3
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      any
    • Number of attachments :
      1

      Description

      Stack trace follows; binding file below (I will also provide a self-contained, zipped up sample that can be used to reproduce this easily):

      Error running binding compiler

          • Error during code generation for file 'binding.xml' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***

      java.lang.IllegalStateException: Internal error: Expected ParagraphType on stack, found java.lang.Object
      full stack:
      0: java.lang.Object
      1: org.jibx.runtime.impl.UnmarshallingContext

      at org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:420)
      at org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:537)
      at org.jibx.binding.classes.MethodBuilder.appendCallVirtual(MethodBuilder.java:894)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalCall(ObjectBinding.java:579)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:834)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:252)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
      at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:252)
      at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
      at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
      at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
      at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:599)
      at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:669)
      at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661)
      at org.jibx.binding.Compile.compile(Compile.java:305)
      at org.jibx.binding.Compile.main(Compile.java:385)

      Binding file:

      <binding direction="both">
      <!-- OTA_HotelAvailRS -->
      <mapping name="HotelItem" class="HotelAvailRSMapper"
      ordered="false">

      <structure name="RoomStays" ordered="false" usage="optional" test-method="isOk">
      <collection field="roomStays" usage="optional">
      <structure name="RoomStay" usage="optional"
      type="RoomStayType" >

      <structure name="RoomRates" usage="optional" test-method="hasRates" >
      <collection field="roomRates" usage="optional">
      <structure name="RoomRate" usage="optional"
      type="RoomRateType" >

      <structure name="Features" usage="optional" test-method="hasRoomPromotions" >
      <collection field="roomPromotions" usage="optional">
      <structure name="Feature" usage="optional">
      <structure name="Description" usage="optional"
      type="ParagraphType">
      <value style="element" name="Text" field="text" usage="optional"/>
      </structure>
      </structure>
      </collection>
      </structure>

      </structure>
      </collection>
      </structure>

      </structure>
      </collection>
      </structure>

      </mapping>
      <!-- TVLY_HotelAvailRS -->

      </binding>

      ... I can't see anything obviously wrong with this binding file, either - I'm presently seeking a workaround for this specific issue (this is the last issue standing in my way from upgrading from beta3c to 1.1, at long, long last).

        Activity

        Hide
        Joshua Davies added a comment -

        To reproduce, just unzip the attached "tvly_jibx.zip" file, modify the "JIBX_PATH" in the build.sh script to point to a jibx 1.1.3 installation, and run ./build.sh. You should see the same stack trace. This appears to happen in every 1.1.x version, but does not occur in rc1 or rc0 (or before that).

        Show
        Joshua Davies added a comment - To reproduce, just unzip the attached "tvly_jibx.zip" file, modify the "JIBX_PATH" in the build.sh script to point to a jibx 1.1.3 installation, and run ./build.sh. You should see the same stack trace. This appears to happen in every 1.1.x version, but does not occur in rc1 or rc0 (or before that).
        Hide
        Joshua Davies added a comment -

        I was able to pare the binding that reproduces the error down a little bit, so the stack trace isn't quite so large:

        <binding direction="both">
        <mapping name="RoomRate" class="RoomRateType" >
        <structure name="Features" usage="optional" test-method="hasRoomPromotions" >
        <collection field="roomPromotions" usage="optional">
        <structure name="Feature" usage="optional">
        <structure name="Description" usage="optional"
        type="ParagraphType">
        <value style="element" name="Text" field="text" usage="optional"/>
        </structure>
        </structure>
        </collection>
        </structure>
        </mapping>
        </binding>

        The class files in the attachment are the same.

        Show
        Joshua Davies added a comment - I was able to pare the binding that reproduces the error down a little bit, so the stack trace isn't quite so large: <binding direction="both"> <mapping name="RoomRate" class="RoomRateType" > <structure name="Features" usage="optional" test-method="hasRoomPromotions" > <collection field="roomPromotions" usage="optional"> <structure name="Feature" usage="optional"> <structure name="Description" usage="optional" type="ParagraphType"> <value style="element" name="Text" field="text" usage="optional"/> </structure> </structure> </collection> </structure> </mapping> </binding> The class files in the attachment are the same.
        Hide
        Joshua Davies added a comment -

        And the corresponding stack trace (essentially the same, but with slightly less clutter):

            • Error during code generation for file 'binding1.xml' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***

        java.lang.IllegalStateException: Internal error: Expected ParagraphType on stack, found java.lang.Object
        full stack:
        0: java.lang.Object
        1: org.jibx.runtime.impl.UnmarshallingContext

        at org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:420)
        at org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:537)
        at org.jibx.binding.classes.MethodBuilder.appendCallVirtual(MethodBuilder.java:894)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalCall(ObjectBinding.java:579)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:834)
        at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
        at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
        at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
        at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
        at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
        at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
        at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
        at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
        at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256)
        at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
        at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
        at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
        at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
        at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
        at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
        at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:599)
        at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:669)
        at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661)
        at org.jibx.binding.Compile.compile(Compile.java:305)
        at org.jibx.binding.Compile.main(Compile.java:385)

        Show
        Joshua Davies added a comment - And the corresponding stack trace (essentially the same, but with slightly less clutter): Error during code generation for file 'binding1.xml' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page *** java.lang.IllegalStateException: Internal error: Expected ParagraphType on stack, found java.lang.Object full stack: 0: java.lang.Object 1: org.jibx.runtime.impl.UnmarshallingContext at org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:420) at org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:537) at org.jibx.binding.classes.MethodBuilder.appendCallVirtual(MethodBuilder.java:894) at org.jibx.binding.def.ObjectBinding.genUnmarshalCall(ObjectBinding.java:579) at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:834) at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943) at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315) at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111) at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190) at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798) at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943) at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315) at org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:167) at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798) at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943) at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:256) at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315) at org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111) at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190) at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798) at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943) at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315) at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:599) at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:669) at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661) at org.jibx.binding.Compile.compile(Compile.java:305) at org.jibx.binding.Compile.main(Compile.java:385)
        Hide
        Joshua Davies added a comment -

        After playing around with this a little, I found that if I move the

        <structure name="Feature" usage="optional">

        element up above the collection element, it compiles correctly... I believe that this doesn't change the semantics, so I might have a workaround... although I'd still like to know what's triggering the bug.

        Show
        Joshua Davies added a comment - After playing around with this a little, I found that if I move the <structure name="Feature" usage="optional"> element up above the collection element, it compiles correctly... I believe that this doesn't change the semantics, so I might have a workaround... although I'd still like to know what's triggering the bug.
        Hide
        Joshua Davies added a comment -

        Well, no, I take that back - that does change the semantics from:

        <Feature>
        <Description>Hotel promo 1 goes here</Description>
        </Feature>
        <Feature>
        <Description>Hotel promo 2 goes here</Description>
        </Feature>

        to:

        <Feature>
        <Description>Hotel promo 1 goes here</Description>
        <Description>Hotel promo 2 goes here</Description>
        </Feature>

        which would make a difference.

        Show
        Joshua Davies added a comment - Well, no, I take that back - that does change the semantics from: <Feature> <Description>Hotel promo 1 goes here</Description> </Feature> <Feature> <Description>Hotel promo 2 goes here</Description> </Feature> to: <Feature> <Description>Hotel promo 1 goes here</Description> <Description>Hotel promo 2 goes here</Description> </Feature> which would make a difference.
        Hide
        Dennis Sosnoski added a comment -

        The problem here is the nested <structure>s within the <collection>, with the type only specified on the inner one. Changing this to:

        <collection field="roomPromotions" usage="optional">
        <structure name="Feature" type="ParagraphType" usage="optional">
        <structure name="Description" usage="optional">
        <value style="element" name="Text" field="text" usage="optional"/>
        </structure>
        </structure>
        </collection>

        compiles fine, though I haven't tried actually testing the code (since you didn't include the test program or data). I'll see about adding a check to catch this during binding validation.

        Show
        Dennis Sosnoski added a comment - The problem here is the nested <structure>s within the <collection>, with the type only specified on the inner one. Changing this to: <collection field="roomPromotions" usage="optional"> <structure name="Feature" type="ParagraphType" usage="optional"> <structure name="Description" usage="optional"> <value style="element" name="Text" field="text" usage="optional"/> </structure> </structure> </collection> compiles fine, though I haven't tried actually testing the code (since you didn't include the test program or data). I'll see about adding a check to catch this during binding validation.
        Hide
        Dennis Sosnoski added a comment -

        Added validation check, which now gives an error on this binding:

        Error: Type must be specified on outermost <structure> element within collection; on structure element at (line 18, col 60, in binding.xml)

        Show
        Dennis Sosnoski added a comment - Added validation check, which now gives an error on this binding: Error: Type must be specified on outermost <structure> element within collection; on structure element at (line 18, col 60, in binding.xml)
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Assignee Dennis Sosnoski [ dsosnoski ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: