[prev in list] [next in list] [prev in thread] [next in thread]
List: jibx-users
Subject: [jibx-users] JiBXException when unmarshalling a valid XML
From: "Wang, Lei1 " <lei1.wang () citi ! com>
Date: 2009-07-28 12:59:56
Message-ID: 6E2C77074744C241B6779E5832D588F8024DE48EDA () exnjmb86 ! nam ! nsroot ! net
[Download RAW message or body]
Hi,
I am using JiBX 1.21.1 on Windows XP. Given the following schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://jibx.org/starter" targetNamespace="http://jibx.org/starter">
<xs:element name="product">
<xs:complexType>
<xs:sequence>
<xs:element ref="productName"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="productName" type="xs:string"/>
</xs:schema>
No problem with codegen and binding. But when I unmarshal this XML:
<product xmlns="http://jibx.org/starter">
<productName>xyz</productName>
</product>
I received JiBXException:
[java] Exception in thread "main" org.jibx.runtime.JiBXException: Expected \
"{http://jibx.org/starter}productName" start tag, found \
"{http://jibx.org/starter}productName" end tag (line 2, col 35)
[java] at org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:652)
[java] at org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:685)
[java] at org.jibx.runtime.impl.UnmarshallingContext.parseElementText(UnmarshallingContext.java:940)
[java] at org.jibx.starter.ProductName.JiBX_binding_unmarshal_1_0(Unknown \
Source)
[java] at org.jibx.starter.JiBX_bindingProductName_access.unmarshal()
[java] at org.jibx.starter.Product.JiBX_binding_unmarshal_1_0(Unknown \
Source) [java] at org.jibx.starter.JiBX_bindingProduct_access.unmarshal()
[java] at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2762)
[java] at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2919)
Does anyone know what happened? It is a simple schema and XML is valid.
Thanks in advance.
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 \
2px solid; } --></style> </head>
<body>
<font face="Arial, sans-serif" size="2">
<div>Hi,</div>
<div> </div>
<div>I am using JiBX 1.21.1 on Windows XP. Given the following schema</div>
<div> </div>
<div><?xml version="1.0" encoding="UTF-8"?></div>
<div><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"</div>
<div> xmlns="http://jibx.org/starter" \
targetNamespace="http://jibx.org/starter"></div> \
<div> <xs:element \
name="product"></div> \
<div> \
<xs:complexType></div> \
<div> \
<xs:sequence></div> \
<div> &nb \
sp; \
<xs:element ref="productName"></xs:element></div> \
<div> \
</xs:sequence></div> \
<div> \
</xs:complexType></div> <div> \
</xs:element></div> <div> </div>
<div> <xs:element \
name="productName" type="xs:string"/></div> \
<div></xs:schema></div> <div> </div>
<div>No problem with codegen and binding. But when I unmarshal this XML:</div>
<div> </div>
<div><product xmlns="http://jibx.org/starter"></div>
<div> <productName>xyz</productName></div>
<div></product></div>
<div> </div>
<div>I received JiBXException:</div>
<div> </div>
<div> [java] Exception in thread "main" \
org.jibx.runtime.JiBXException: Expected "{<a \
href="http://jibx.org/starter}productName"><font \
color="#0000FF"><u>http://jibx.org/starter}productName</u></font></a>" start \
tag, found "{<a href="http://jibx.org/starter}productName"><font \
color="#0000FF"><u>http://jibx.org/starter}productName</u></font></a>" end tag \
(line 2, col 35)</div> <div> [java] \
at org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:652)</div>
<div> [java] at \
org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:685)</div>
<div> [java] at \
org.jibx.runtime.impl.UnmarshallingContext.parseElementText(UnmarshallingContext.java:940)</div>
<div> [java] at \
org.jibx.starter.ProductName.JiBX_binding_unmarshal_1_0(Unknown Source)</div> \
<div> [java] at \
org.jibx.starter.JiBX_bindingProductName_access.unmarshal()</div> \
<div> [java] at \
org.jibx.starter.Product.JiBX_binding_unmarshal_1_0(Unknown Source)</div> \
<div> [java] at \
org.jibx.starter.JiBX_bindingProduct_access.unmarshal()</div> \
<div> [java] at \
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2762)</div>
<div> [java] at \
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2919)</div>
<div> </div>
<div>Does anyone know what happened? It is a simple schema and XML is valid.</div>
<div> </div>
<div>Thanks in advance.</div>
<div> </div>
<div> </div>
<div><font face="Arial, sans-serif"> </font></div>
</font>
</body>
</html>
[Attachment #4 (--===============5708366407826295279==)]
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic