Title: Message
Basically I have a object which has HashMap of dbColumns and HAshMap of tableProperties.
My binding.xml is as follows. The data.xml is also attached.
When I try to run the TestRoundTrip I get the following error
 
runbindings:
      [jar] Building jar: C:\jibx\lib\runtimebindings.jar
 
runTest16:
     [java] org.jibx.runtime.JiBXException: Expected start tag, found end tag "e
ntry" (line 14, col 48)
     [java]     at org.jibx.runtime.impl.UnmarshallingContext.toStart(Unmarshall
ingContext.java:489)
     [java]     at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(U
nmarshallingContext.java:2561)
     [java]     at org.jibx.custombindings.HashMapper.unmarshal(HashMapper.java:
157)
     [java]     at example16.DBTable.JiBX_jibx_tutorial_example16_binding_unmars
hal_1_0(DBTable.java)
     [java]     at example16.JiBX_jibx_tutorial_example16_bindingDBTable_access.
unmarshal()
     [java]     at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(U
nmarshallingContext.java:2568)
     [java]     at org.jibx.custombindings.HashMapper.unmarshal(HashMapper.java:
157)
     [java]     at example16.DBModel.JiBX_jibx_tutorial_example16_binding_unmars
hal_1_0(DBModel.java)
     [java]     at example16.JiBX_jibx_tutorial_example16_bindingDBModel_access.
unmarshal()
     [java]     at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(U
nmarshallingContext.java:2568)
     [java]     at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(
UnmarshallingContext.java:2736)
     [java]     at org.jibx.extras.TestRoundtrip.runTest(TestRoundtrip.java:86)
     [java]     at org.jibx.extras.TestRoundtrip.main(TestRoundtrip.java:140)
     [java] Error round-tripping class: example16.DBModel
     [java]  with input file example16/data.xml and output compared to example16
/data.xml
     [java] Saved output document file path C:\jibx\tutorial\temp.xml
 
BUILD FAILED
file:C:/jibx/tutorial/build.xml:346: Java returned: 1
 
Any inputs or suggestions ?
 
Thanks in Advance
Sudhi
<binding>
	<mapping name="dbModel" class="example16.DBModel">
		
		<structure field="dbTables" name= "map"
			marshaller="org.jibx.custombindings.HashMapper" unmarshaller="org.jibx.custombindings.HashMapper"/>
		
		<collection field="attributes" item-type="example16.Attr" />

		<value style="attribute" name="name" field="name"/>
		<value style="attribute" name="type" field="type"/>
	</mapping>

	<mapping name="attribute" class="example16.Attr">
		<value style="attribute" name="name" field="name"/>
		<value style="attribute" name="type" field="type"/>
		<value style="attribute" name="value" field="value"/>
	</mapping>
	
	<mapping name="dbTable" class="example16.DBTable">
		<value style="attribute" name="name" field="name"/>

		<structure field="dbColumns" name= "map"
			marshaller="org.jibx.custombindings.HashMapper" unmarshaller="org.jibx.custombindings.HashMapper"/>

		<structure field="tableProperties" name= "map"
			marshaller="org.jibx.custombindings.HashMapper" unmarshaller="org.jibx.custombindings.HashMapper"/>
	</mapping>
	
	<mapping name="dbColumn" class="example16.DBColumn">
		<value style="attribute" name="name" field="name"/>
		<value style="attribute" name="type" field="type"/>
		<value style="attribute" name="scale" field="scale"/>
		<value style="attribute" name="precision" field="precision"/>
		<value style="attribute" name="ordinalPosition" field="ordinalPosition"/>
		<value style="attribute" name="isPrimaryKey" field="isPrimaryKey"/>
		<value style="attribute" name="isForeignKey" field="isForeignKey"/>
		<value style="attribute" name="indexed" field="indexed"/>
		<value style="attribute" name="nullable" field="nullable"/>
	</mapping>	
	
</binding>

	
<dbModel name="fdff" type="source">
	<map size="2">
		<entry key="TEST1_CSV">
			<dbTable name="TEST1_CSV">
				<map size="2">
					<entry key="NAME">
						<dbColumn name="NAME" type="12" scale="0" precision="25" ordinalPosition="2" isPrimaryKey="false" isForeignKey="false" indexed="false" nullable="true" />
					</entry>	
					<entry key="ID">
						<dbColumn name="ID" type="12" scale="0" precision="4" ordinalPosition="1" isPrimaryKey="false" isForeignKey="false" indexed="false" nullable="true" />
					</entry>
				</map>	
				<map size="2">
					<entry key="RecordDelimiter">slash</entry>	
					<entry key="FieldCount">5</entry>
				</map>	
			</dbTable>
		</entry>
		<entry key="TEST2_CSV">
			<dbTable name="TEST2_CSV">
			<map size="2">
				<entry key="NAME">
					<dbColumn name="NAME" type="12" scale="0" precision="25" ordinalPosition="2" isPrimaryKey="false" isForeignKey="false" indexed="false" nullable="true" />
				</entry>	
				<entry key="ID">
					<dbColumn name="ID" type="12" scale="0" precision="4" ordinalPosition="1" isPrimaryKey="false" isForeignKey="false" indexed="false" nullable="true" />
				</entry>
			</map>	
			</dbTable>
		</entry> 
	</map>
	<attribute name="danar" type="java.lang.String" value="Rit"/>
	<attribute name="danar1" type="java.lang.String" value="damn"/>
</dbModel>

Attachment: HashMapper.java
Description: HashMapper.java

Attachment: Attr.java
Description: Attr.java

Attachment: DBColumn.java
Description: DBColumn.java

Attachment: DBModel.java
Description: DBModel.java

Attachment: DBTable.java
Description: DBTable.java

Reply via email to