Hello, we are using hibernate XML Databinder and ReverseXML to sync up data from different mysql servers. The problem is whenever an xml generated by XML Databinder is read by ReverseXML to load in the database, the error below occurs
org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
looking at the xml, I dont seem to find any elements or structures with no pairs. There is no code that in our system that opens or manipulates the xml file. Only XMLDatabinder and ReverseXML are touching the xml.
I notice that this error occurs whenever a collection element exist in the xml, meaning the table has some details.
Some code:
List objList = new ArrayList();
String incomingDir = "";
String fileLoc = incomingDir + xmlFile;
try {
File tmp = new File(incomingDir);
if(!tmp.exists()) tmp.mkdir();
SessionFactoryImplementor factory = (SessionFactoryImplementor)
getSessionFactory();
SessionImplementor session = (SessionImplementor) getSession();
FileInputStream file = new FileInputStream(fileLoc);
ReverseXMLDataBinder xmlDataBinder = new ReverseXMLDataBinder
(factory, session);
xmlDataBinder.fromXML(file);
objList = xmlDataBinder.getObjects();
}
catch (Exception e) {
log.debug("Error converting to object : Err is " + e.getMessage());
}
return objList;
Thanks for your answers.
|