Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Note:</strong> I'm the <a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow"><strong>EclipseLink JAXB (MOXy)</strong></a> lead and a member of the <a href="http://jcp.org/en/jsr/detail?id=222" rel="nofollow"><strong>JAXB (JSR-222)</strong></a> expert group.</p> <blockquote> <p>@BlaiseDoughan here is a link of an eclipse project that reproduces the error, setup a break point at line 72 in AIRIP.java, run the debug, and have a look at a -> messages -> elementData[26] -> params -> elementData[15] -> name for an example of this error. edit: you'll have to add the eclipselink jar to your porject <a href="https://rapidshare.com/files/4092394426/reproduceXMLError.zip" rel="nofollow">link</a></p> </blockquote> <p>Based on the project you linked to (thank you for providing that). If you remove MOXy from the picture you see interesting results:</p> <p><strong>SAXDemo</strong></p> <p>Currently when you unmarshal from a <code>File</code> MOXy will process the XML input using a SAX parser. Below I've created a simple application that uses a SAX parser to process the XML document you provided and output the contents of all the character events that contain the String "&lt;".</p> <pre><code>import javax.xml.parsers.*; import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; public class SAXDemo { public static void main(String[] args) throws Exception { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); xr.setContentHandler(new DefaultHandler() { @Override public void characters(char[] ch, int start, int length) throws SAXException { String string = new String(ch, start, length); if(string.contains("&lt;")) { System.out.println(string); } }} ); xr.parse("ressources/messages001.xml"); } } </code></pre> <p><strong>Output</strong></p> <p>Below is the output from running the demo code. Most of the lines correspond to content id <code>CDATA</code> sections so they're expected, but the line <code>/param&gt;&lt;param&gt;&lt;name&gt;subscrlag</code> is not. This means that reason MOXy is unmarshalling the wrong value is that the underlying SAX parser is reporting the wrong characters event.</p> <pre><code>&lt;node relation=\"XOR\"&gt;&lt;name&gt;adjustmentAmountRelative&lt;/name&gt;&lt;name&gt;mainAccountValueNew&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"AND\" comment=\"in case the request is an update of already assigned community\"&gt;&lt;name&gt;communityInformationCurrent&lt;/name&gt;&lt;name&gt;communityInformationNew&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"AND\"&gt;&lt;name&gt;promotionPlanID&lt;/name&gt;&lt;name&gt;promotionStartDate&lt;/name&gt;&lt;name&gt;promotionEndDate&lt;/name&gt;&lt;/node&gt; /param&gt;&lt;param&gt;&lt;name&gt;subscrlag &lt;node relation=\"XOR\"&gt;&lt;name&gt;adjustmentAmountRelative&lt;/name&gt;&lt;name&gt;mainAccountValueNew&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;supervisionExpiryDateRelative&lt;/name&gt;&lt;name&gt;supervisionExpiryDate&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;serviceFeeExpiryDateRelative&lt;/name&gt;&lt;name&gt;serviceFeeExpiryDate&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"OR\"&gt;&lt;name&gt;msisdnCurrent&lt;/name&gt;&lt;name&gt;msisdnCurrentNAI&lt;/name&gt;&lt;name&gt;msisdnNew&lt;/name&gt;&lt;name&gt;msisdnNewNAI&lt;/name&gt;&lt;name&gt;imsiCurrent&lt;/name&gt;&lt;name&gt;imsiNew&lt;/name&gt;&lt;name&gt;naiCurrent&lt;/name&gt;&lt;name&gt;naiNew&lt;/name&gt;&lt;name&gt;sipUriCurrent&lt;/name&gt;&lt;name&gt;sipUriNew&lt;/name&gt;&lt;name&gt;privateCurrent&lt;/name&gt;&lt;name&gt;privateNew&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;chargingInformation&lt;/name&gt;&lt;name&gt;externalContract&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"AND\" comment=\"in case the request is an update of already assigned community\"&gt;&lt;name&gt;communityInformationCurrent&lt;/name&gt;&lt;name&gt;communityInformationNew&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"XOR\"&gt;&lt;name&gt;fafInformation&lt;/name&gt;&lt;name&gt;fafInformationList&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"AND\"&gt;&lt;name&gt;selectedOption&lt;/name&gt;&lt;name&gt;chargingRequestInformation&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"XOR\"&gt;&lt;node relation=\"\"&gt;&lt;name&gt;updateAction&lt;/name&gt;&lt;name&gt;productID&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"\"&gt;&lt;node relation=\"XOR\"&gt;&lt;node relation=\"OR\"&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;startDate&lt;/name&gt;&lt;name&gt;startDateRelative&lt;/name&gt;&lt;node relation=\"\" comment=\"Optional\"&gt;&lt;name&gt;startPamPeriodIndicator&lt;/name&gt;&lt;name&gt;currentTimeOffset&lt;/name&gt;&lt;/node&gt;&lt;/node&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;expiryDate&lt;/name&gt;&lt;name&gt;expiryDateRelative&lt;/name&gt;&lt;name&gt;expiryPamPeriodIndicator&lt;/name&gt;&lt;/node&gt;&lt;/node&gt;&lt;node relation=\"OR\"&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;startDateTime&lt;/name&gt;&lt;name&gt;startDateTimeRelative&lt;/name&gt;&lt;/node&gt;&lt;node relation=\"XOR\"&gt;&lt;name&gt;expiryDateTime&lt;/name&gt;&lt;name&gt;expiryDateTimeRelative&lt;/name&gt;&lt;/node&gt;&lt;/node&gt;&lt;/node&gt;&lt;name&gt;pamServiceID&lt;/name&gt;&lt;name&gt;offerType&lt;/name&gt;&lt;name&gt;offerProviderID&lt;/name&gt;&lt;name&gt;dedicatedAccountUpdateInformation&lt;/name&gt;&lt;name&gt;attributeUpdateInformationList&lt;/name&gt;&lt;/node&gt;&lt;/node&gt; &lt;node relation=\"OR\"&gt;&lt;name&gt;promotionRefillAmountRelative&lt;/name&gt;&lt;name&gt;promotionRefillCounterStepRelative&lt;/name&gt;&lt;name&gt;progressionRefillAmountRelative&lt;/name&gt;&lt;name&gt;progressionRefillCounterStepRelative&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"OR\"&gt;&lt;name&gt;accountGroupID&lt;/name&gt;&lt;name&gt;serviceOfferings&lt;/name&gt;&lt;/node&gt; &lt;node relation=\"OR\"&gt;&lt;name&gt;usageCounterUpdateInformation&lt;/name&gt;&lt;name&gt;usageThresholdUpdateInformation&lt;/name&gt;&lt;/node&gt; </code></pre> <p><strong>ISSUE - XML Version 1.1</strong></p> <p>Your XML document contains the following header with the version set to <code>1.1</code>. If you change the version to be <code>1.0</code> everything seems to work properly. The default SAX parser implementation in the JDK appears to fail when the version is set to <code>1.1</code>.</p> <pre><code>&lt;?xml version="1.1" encoding="utf-8"?&gt; </code></pre> <p><strong>SOLUTION - Use Another SAX Parser</strong></p> <p>The good thing about using a standard parser API such as SAX is that you can always swap in a new parser. I ran your example adding Xerces2 Java Parser 2.11.0 Release to the classpath, and the example ran as expected.</p> <ul> <li><a href="http://xerces.apache.org/xerces2-j/" rel="nofollow">http://xerces.apache.org/xerces2-j/</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload