Please note that I am using 1.1.5, if I upgrade to 1.2.1 the following
issue vanishes. But I cannot upgrade right now due to issues with
spring-ws and jibx.
I am sure it is something stupid as the xml file is so small
I get the following exception when trying to read in the following xml
file that was generated with a marshaller:
Caused by: java.lang.IllegalStateException: Current state not
START_ELEMENT
at
com.ctc.wstx.sr.BasicStreamReader.getAttributeValue(BasicStreamReader.ja
va:641)
at
org.jibx.runtime.impl.StAXReaderWrapper.getAttributeValue(StAXReaderWrap
per.java:378)
at
org.jibx.runtime.impl.UnmarshallingContext.getAttributeValue(Unmarshalli
ngContext.java:356)
at
org.jibx.runtime.impl.UnmarshallingContext.attributeBoolean(Unmarshallin
gContext.java:1881)
at
com.traffic.hdradio.data.access.traffic.pojo.RadioHDTrafficEventCodeMeta
Data.JiBX_RadioHDTrafficEventCodeMetaData_JiBXBinding_unmarshal_2_0(Radi
oHDTrafficEventCodeMetaData.java)
at
com.traffic.hdradio.data.access.traffic.pojo.JiBX_RadioHDTrafficEventCod
eMetaData_JiBXBindingRadioHDTrafficEventCodeMetaData_access.unmarshal()
at
com.traffic.hdradio.data.access.traffic.pojo.JiBX_MungeAdapter.JiBX_Radi
oHDTrafficEventCodeMetaData_JiBXBinding_unmarshal_1_0()
at
com.traffic.hdradio.data.access.traffic.pojo.RadioHDTrafficEventCodeMeta
DataList.JiBX_RadioHDTrafficEventCodeMetaData_JiBXBinding_unmarshal_1_0(
RadioHDTrafficEventCodeMetaDataList.java)
at
com.traffic.hdradio.data.access.traffic.pojo.JiBX_RadioHDTrafficEventCod
eMetaData_JiBXBindingRadioHDTrafficEventCodeMetaDataList_access.unmarsha
l()
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshallin
gContext.java:2537)
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unmarshalli
ngContext.java:2694)
at
com.traffic.hdradio.data.access.traffic.TrafficDataAccessXML.getRadioHDT
rafficEventCodeMetaDataList(TrafficDataAccessXML.java:67)
XML file:
<RadioHDTRafficEventCodeMetaDataList>
<RadioHDTRafficEventCodeMetaData>
<EventCode>992</EventCode>
<AlertCEventCode>12</AlertCEventCode>
<SilentSpoken>0</SilentSpoken>
<NowOrForecastEvent>0</NowOrForecastEvent>
<DirectionOfTravel>0</DirectionOfTravel>
<Priority>1</Priority>
<QuantifierDefault>11111111</QuantifierDefault>
<DiversionRecommended>0</DiversionRecommended>
</RadioHDTRafficEventCodeMetaData>
</RadioHDTRafficEventCodeMetaDataList>
Java files:
public class RadioHDTrafficEventCodeMetaDataList
{
private ArrayList<RadioHDTrafficEventCodeMetaData>
radioHDTrafficEventCodeMetaDataList;
public RadioHDTrafficEventCodeMetaDataList( )
{
radioHDTrafficEventCodeMetaDataList =
new ArrayList<RadioHDTrafficEventCodeMetaData>( );
}
public ArrayList<RadioHDTrafficEventCodeMetaData>
getRadioHDTrafficEventCodeMetaDataList()
{
return radioHDTrafficEventCodeMetaDataList;
}
public void setRadioHDTrafficEventCodeMetaDataList(
ArrayList<RadioHDTrafficEventCodeMetaData>
radioHDTrafficEventCodeMetaDataList )
{
this.radioHDTrafficEventCodeMetaDataList =
radioHDTrafficEventCodeMetaDataList;
}
}
public class RadioHDTrafficEventCodeMetaData
extends RadioStationBase
{
private Short eventCode;
private Short eventQuantifier;
private Short alertCEventCode;
private Byte silentSpoken;
private Byte nowOrForecastEvent;
private Byte directionOfTravel;
private Byte priority;
private String quantifierDefault;
private Byte diversionRecommended;
public RadioHDTrafficEventCodeMetaData()
{
}
public RadioHDTrafficEventCodeMetaData( Short eventCode,
Short eventQuantifier,
Short alertCEventCode,
Byte silentSpoken,
Byte nowOrForecastEvent,
Byte directionOfTravel,
Byte priority,
String quantifierDefault,
Byte diversionRecommended,
String createdBy,
Date createdDate,
String modifiedBy,
Date modifiedDate )
{
super( createdBy, createdDate, modifiedBy, modifiedDate );
this.eventCode = eventCode;
this.eventQuantifier = eventQuantifier;
this.alertCEventCode = alertCEventCode;
this.silentSpoken = silentSpoken;
this.nowOrForecastEvent = nowOrForecastEvent;
this.directionOfTravel = directionOfTravel;
this.priority = priority;
this.quantifierDefault = quantifierDefault;
this.diversionRecommended = diversionRecommended;
}
public Short getEventCode()
{
return eventCode;
}
public void setEventCode( Short eventCode )
{
this.eventCode = eventCode;
}
public Short getEventQuantifier()
{
return eventQuantifier;
}
public void setEventQuantifier( Short eventQuantifier )
{
this.eventQuantifier = eventQuantifier;
}
public Short getAlertCEventCode()
{
return alertCEventCode;
}
public void setAlertCEventCode( Short alertCEventCode )
{
this.alertCEventCode = alertCEventCode;
}
public Byte getSilentSpoken()
{
return silentSpoken;
}
public void setSilentSpoken( Byte silentSpoken )
{
this.silentSpoken = silentSpoken;
}
public Byte getNowOrForecastEvent()
{
return nowOrForecastEvent;
}
public void setNowOrForecastEvent( Byte nowOrForecastEvent )
{
this.nowOrForecastEvent = nowOrForecastEvent;
}
public Byte getDirectionOfTravel()
{
return directionOfTravel;
}
public void setDirectionOfTravel( Byte directionOfTravel )
{
this.directionOfTravel = directionOfTravel;
}
public Byte getPriority()
{
return priority;
}
public void setPriority( Byte priority )
{
this.priority = priority;
}
public String getQuantifierDefault()
{
return quantifierDefault;
}
public void setQuantifierDefault( String quantifierDefault )
{
this.quantifierDefault = quantifierDefault;
}
public Byte getDiversionRecommended()
{
return diversionRecommended;
}
public void setDiversionRecommended( Byte diversionRecommended )
{
this.diversionRecommended = diversionRecommended;
}
@Override
public boolean equals( Object compareObject )
{
if ( this == compareObject )
{
return true;
}
if ( compareObject == null || getClass() !=
compareObject.getClass() )
{
return false;
}
RadioHDTrafficEventCodeMetaData that =
(RadioHDTrafficEventCodeMetaData) compareObject;
if ( !eventCode.equals( that.eventCode ) )
{
return false;
}
return true;
}
@Override
public int hashCode()
{
return eventCode.hashCode();
}
Config file:
<binding>
<mapping name="RadioHDTRafficEventCodeMetaDataList"
class="com.traffic.hdradio.data.access.traffic.pojo.RadioHDTrafficEventC
odeMetaDataList">
<collection field="radioHDTrafficEventCodeMetaDataList"
item-type="com.traffic.hdradio.data.access.traffic.pojo.RadioHDTrafficEv
entCodeMetaData"
usage="optional"/>
</mapping>
<mapping name="RadioHDTRafficEventCodeMetaData"
class="com.traffic.hdradio.data.access.traffic.pojo.RadioHDTrafficEventC
odeMetaData">
<value name="EventCode"
field="eventCode"
type="java.lang.Short"
usage="optional"
nillable="true"/>
<value name="EventQuantifier"
field="eventQuantifier"
type="java.lang.Short"
usage="optional"/>
<value name="AlertCEventCode"
field="alertCEventCode"
type="java.lang.Short"
usage="optional"/>
<value name="SilentSpoken"
field="silentSpoken"
type="java.lang.Byte"
usage="optional"/>
<value name="NowOrForecastEvent"
field="nowOrForecastEvent"
type="java.lang.Byte"
usage="optional"/>
<value name="DirectionOfTravel"
field="directionOfTravel"
type="java.lang.Byte"
usage="optional"/>
<value name="Priority"
field="priority"
type="java.lang.Byte"
usage="optional"/>
<value name="QuantifierDefault"
field="quantifierDefault"
type="java.lang.String"
usage="optional"/>
<value name="DiversionRecommended"
field="diversionRecommended"
type="java.lang.Byte"
usage="optional"/>
</mapping>
</binding>
The information contained in this communication may be CONFIDENTIAL and is
intended only for the use of the recipient(s) named above. If you are not the
intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication, or any of its contents, is
strictly prohibited. If you have received this communication in error, please
notify the sender and delete/destroy the original message and any copy of it
from your computer or paper files.
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users