I'm getting this error:

Exception in thread "main" org.jibx.runtime.JiBXException: Expected
"Ogz" start tag, found "OgzNr" start tag (line 1, col 38)
        at 
org.jibx.runtime.impl.UnmarshallingContext.throwStartTagNameError(UnmarshallingContext.java:220)
        at 
org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:644)
        at 
org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:680)
        at com.ups.ops.gio.vo.GioOgzVo.JiBX_binding_unmarshal_1_0(GioOgzVo.java)
        at com.ups.ops.gio.vo.JiBX_bindingGioOgzVo_access.unmarshal()
        at 
com.ups.ops.gio.vo.GioCurLocGrpVo.JiBX_binding_unmarshal_1_0(GioCurLocGrpVo.java)
        at 
com.ups.ops.gio.vo.GioShuCompositeVo.JiBX_binding_unmarshal_1_0(GioShuCompositeVo.java)
        at com.ups.ops.gio.vo.JiBX_bindingGioShuCompositeVo_access.unmarshal()
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2914)

When I try to unmarshal this XML (all one line):

<UpsBasDb><CurLocGrp><Loc><Ogz><OgzNr>3229</OgzNr><Cny><CnyCd>US</CnyCd></Cny></Ogz></Loc><Ts>2012-09-28T00:20:32.000-04:00</Ts></CurLocGrp></UpsBasDb>

However, if I pass the same XML formatted with newlines, it works!

<UpsBasDb>
   <CurLocGrp>
      <Loc>
         <Ogz>
            <OgzNr>3229</OgzNr>
            <Cny>
               <CnyCd>US</CnyCd>
            </Cny>
         </Ogz>
      </Loc>
      <Ts>2012-09-28T00:20:32.000-04:00</Ts>
   </CurLocGrp>
</UpsBasDb>

Here is the binding.xml file:

<binding package="com.ups.ops.gio.vo">
  <mapping name="UpsBasDb" class="com.ups.ops.gio.vo.GioShuCompositeVo">

    <structure field="orgLocGrp" usage="optional"/>

    <structure name="CurLocGrp" field="curLocGrp" usage="optional">
          <structure name="Loc">
            <structure field="ogz" type="com.ups.ops.gio.vo.GioOgzVo" />
          </structure>
      <value name="Ts" field="udtTs"/>
    </structure>

  </mapping>

  <mapping name="OrgLocGrp" class="com.ups.ops.gio.vo.GioOrgLocGrpVo"
extends="com.ups.ops.gio.vo.GioOgzVo">
    <structure map-as="com.ups.ops.gio.vo.GioOgzVo"/>
    <structure name="TptDtTm">
      <value name="DtTmVlu" field="shuPuDt" usage="optional"/>
    </structure>
    <value name="Ts" field="udtTs"/>
  </mapping>

  <mapping class="com.ups.ops.gio.vo.GioOgzVo" abstract="true">
    <structure name="Ogz">
      <value name="OgzNr" field="ogzNr"/>
      <structure name="Cny">
        <value name="CnyCd" field="cnyCd"/>
      </structure>
      <structure name="Fac" usage="optional">
        <structure name="FacCny" usage="optional">
          <structure name="CnyCd" usage="optional"/>
        </structure>
        <value name="FacMnm" field="facMnm" usage="optional"/>
        <value name="FacLocNr" field="facLocNr" usage="optional"/>
        <value name="InBdgLocNr" field="inBdgLocNr" usage="optional"/>
      </structure>
    </structure>
    <structure name="Srt" usage="optional">
      <structure name="SrtCgy" usage="optional">
        <value name="Cd" field="srtTypCd" usage="optional"/>
      </structure>
    </structure>
  </mapping>
</binding>

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to