Hi,

I have been using JiBX with my application to persist application document as XML for a while and everything is working fine. Lately I found that on "some" document, there is a problem when marshalling, the following are stacktrace when try to save the document to XML:

Error writing marshalled document
java.io.IOException: Illegal character code 0x0 in content text
        at org.jibx.runtime.impl.UTF8StreamWriter.writeTextContent(Unknown 
Source)
        at org.jibx.runtime.impl.MarshallingContext.element(Unknown Source)
        at 
com.waveman.campaign.entity.Unit.JiBX_unit_binding_marshal_1_0(Unit.java)
        at com.waveman.campaign.entity.JiBX_unit_bindingUnit_access.marshal()
        at com.waveman.campaign.entity.Unit.marshal(Unit.java)
        at 
com.waveman.campaign.jibx.JibxXmlConverter.convertUnitToXml(JibxXmlConverter.java:87)

The document is create withing the application and persist to XML using JiBX. And then loading the document back to the application using JiBX again is also correct. But the save (marshalling) process could no longer be done.
This problem happens to only *some* document. I've attached a very simple one 
that cause this problem.

Does anyone have some idea why the problem happens?

Regards,

Vairoj

<?xml version="1.0" encoding="UTF-8"?>
<unit>
   <callsign>AAA</callsign>
   <side>Blue</side>
   <type>Infantry</type>
   <level>Division</level>
   <chainofcommandsubordinate>
   </chainofcommandsubordinate>
</unit>

Reply via email to