JiBX
  1. JiBX
  2. JIBX-107

Nested Collections Create exceptions

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: JiBX 1.0.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows XP
      Eclipse Ant Build
    • Number of attachments :
      0

      Description

      I am using the following mapping file

      <binding>
      <mapping name="RulesDescr" class="org.drools.lang.descr.RuleDescr">
      <value name="name" style="attribute" field="name"/>
      <value name="documentation" field="documentation" usage="optional" />
      <value name="consequence" field="consequence" />
      <value name="className" field="className" usage="optional" />
      <structure name="lhs" type="org.drools.lang.descr.AndDescr" >
      <collection field="descrs" type="java.util.ArrayList">
      <structure name="Eval" type="org.drools.lang.descr.EvalDescr" >
      <value name="text" field="text"/>

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

      </binding>

      It shows the below exception and halts. I have tried various combinations but in vain .

      Error running binding compiler
      [bind] *** Error during code generation - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page ***
      [bind] java.lang.IllegalStateException: Internal error: Expected org.drools.lang.descr.AndDescr on stack, found org.drools.lang.descr.RuleDescr
      [bind] full stack:
      [bind] 0: org.drools.lang.descr.RuleDescr
      [bind] 1: org.jibx.runtime.impl.UnmarshallingContext
      [bind] at org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:393)
      [bind] at org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:510)
      [bind] at org.jibx.binding.classes.MethodBuilder.appendCallVirtual(MethodBuilder.java:867)
      [bind] at org.jibx.binding.def.ObjectBinding.genUnmarshalCall(ObjectBinding.java:568)
      [bind] at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:823)
      [bind] at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:932)
      [bind] at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:245)
      [bind] at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:267)
      [bind] at org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:156)
      [bind] at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:787)
      [bind] at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:932)
      [bind] at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:267)
      [bind] at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:592)
      [bind] at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:602)
      [bind] at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:611)
      [bind] at org.jibx.binding.Compile.compile(Compile.java:305)
      [bind] at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
      [bind] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [bind] at org.apache.tools.ant.Task.perform(Task.java:364)
      [bind] at org.apache.tools.ant.Target.execute(Target.java:341)
      [bind] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
      [bind] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
      [bind] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
      [bind] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

      BUILD FAILED

        Activity

        Hide
        Dennis Sosnoski added a comment -

        I get errors on the binding definition when I try to run it:

        [bind] Running binding compiler version jibx_1_0_2
        [bind] Error: Need no-argument constructor or factory method for class org.drools.lang.descr.RuleDescr; on mapping element at (line 2, col 69, in binding.xml)
        [bind] Error: References to structure object must have compatible types: org.drools.lang.descr.RuleDescr cannot be used as org.drools.lang.descr.AndDescr; on structure element at (line 7, col 63, in binding.xml)
        [bind] Error running binding compiler
        [bind] org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of validation errors

        These errors do seem to be correct (though JiBX 1.1 has a way to avoid the no-argument constructor issue). I don't understand why you weren't getting these errors when you ran it, but the problem does seem to be in the binding and not in JiBX.

        Show
        Dennis Sosnoski added a comment - I get errors on the binding definition when I try to run it: [bind] Running binding compiler version jibx_1_0_2 [bind] Error: Need no-argument constructor or factory method for class org.drools.lang.descr.RuleDescr; on mapping element at (line 2, col 69, in binding.xml) [bind] Error: References to structure object must have compatible types: org.drools.lang.descr.RuleDescr cannot be used as org.drools.lang.descr.AndDescr; on structure element at (line 7, col 63, in binding.xml) [bind] Error running binding compiler [bind] org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of validation errors These errors do seem to be correct (though JiBX 1.1 has a way to avoid the no-argument constructor issue). I don't understand why you weren't getting these errors when you ran it, but the problem does seem to be in the binding and not in JiBX.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Jayaram C S
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: