JiBX
  1. JiBX
  2. JIBX-16

"structure ... using..." mistakenly throws Exception with wrong datatype

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0-beta3b
    • Fix Version/s: 1.0-RC0
    • Component/s: core
    • Labels:
      None
    • Environment:
      Solaris 9, Java 1.4.2_03-b02
    • Number of attachments :
      0

      Description

      This works in Beta3a:

      <binding>
      <mapping name="DbObject" class="edu.iris.dmc.db.DbObject"
      abstract="true" >
      <structure name="DbInfo" label="dbFields"
      value-style="attribute" >
      <value name="enteredOn" field="enteredOn" />
      <value name="enteredBy" field="enteredBy" />
      <value name="modifiedOn" field="modifiedOn" />
      <value name="modifiedBy" field="modifiedBy" usage="optional" />
      </structure>
      </mapping>

      <mapping name="Station" class="edu.iris.dmc.isis.Station"
      value-style="attribute" >
      <value name="siteName" field="siteName" />
      <value name="stationCode" field="code" />

      [stuff cut out for brevity]

      <structure name="DbInfo" using="dbFields" />
      </mapping>
      </binding>

      But in Beta3b, I get the following bind-time exception:

      [bind] org.jibx.runtime.JiBXException: Reference to structure dbFields has object of type edu.iris.dmc.isis.Station rather than required java.util.Date
      [bind] at org.jibx.binding.def.StructureReference.setLinkages(StructureReference.java:120)
      [bind] at org.jibx.binding.def.ElementWrapper.setLinkages(ElementWrapper.java:443)
      [bind] at org.jibx.binding.def.NestedStructure.setLinkages(NestedStructure.java:236)
      [bind] at org.jibx.binding.def.PassThroughComponent.setLinkages(PassThroughComponent.java:140)
      [bind] at org.jibx.binding.def.ObjectBinding.setLinkages(ObjectBinding.java:752)
      [bind] at org.jibx.binding.def.ElementWrapper.setLinkages(ElementWrapper.java:443)
      [bind] at org.jibx.binding.def.MappingDefinition.setLinkages(MappingDefinition.java:678)
      [bind] at org.jibx.binding.def.DefinitionContext.setLinkages(DefinitionContext.java:624)
      [bind] at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:524)
      [bind] at org.jibx.binding.Compile.compile(Compile.java:283)
      [bind] at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:238)

      [I admit that this is problably not the best way to do this particular mapping, but the issue remains...]

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Linus Kamb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: