During importing of a fairly large XML file I get the following error:
- ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding The problem is that I cannot determine where in the XML file that the error occurred. I understand that it is using some 3rd party javolution modules. Is there some way to log the line # or XML element that failed? Perhaps I need to set some flag/config for javolution? I did find the following in entitySaxReader.java but never found any such errors in the log: public void startPrefixMapping(CharSequence arg0, CharSequence arg1) throws SAXException {} // ======== ErrorHandler interface implementations ======== public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException { Debug.logWarning(exception, "Error reading XML on line " + exception.getLineNumber() + ", column " + exception.getColumnNumber(), module); } public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException { Debug.logError(exception, "Fatal Error reading XML on line " + exception.getLineNumber() + ", column " + exception.getColumnNumber(), module); throw new SAXException("Fatal Error reading XML on line " + exception.getLineNumber() + ", column " + exception.getColumnNumber(), exception); } public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException { Debug.logWarning(exception, "Warning reading XML on line " + exception.getLineNumber() + ", column " + exception.getColumnNumber(), module); } Thanks, tej |
Tej,
I found this link, http://lists.ofbiz.org/pipermail/users/2005-August/008669.html, by going to advanced google search and searching on "ofbiz" and "Invalid UTF-8 Encoding". HTH -Al On 3/20/07, tej minhas <[hidden email]> wrote: > > During importing of a fairly large XML file I get the following error: > > - ERROR: Error parsing entity xml file: > java.io.CharConversionException: Invalid UTF-8 Encoding > > The problem is that I cannot determine where in the XML file that the > error > occurred. I understand that it is using some 3rd party javolution > modules. > > Is there some way to log the line # or XML element that failed? Perhaps I > need to set some flag/config for javolution? > > I did find the following in entitySaxReader.java but never found any such > errors in the log: > > public void startPrefixMapping(CharSequence arg0, CharSequence arg1) > throws SAXException {} > > // ======== ErrorHandler interface implementations ======== > > public void error(org.xml.sax.SAXParseException exception) throws > org.xml.sax.SAXException { > Debug.logWarning(exception, "Error reading XML on line " + > exception.getLineNumber() + ", column " + exception.getColumnNumber(), > module); > } > > public void fatalError(org.xml.sax.SAXParseException exception) throws > org.xml.sax.SAXException { > Debug.logError(exception, "Fatal Error reading XML on line " + > exception.getLineNumber() + ", column " + exception.getColumnNumber(), > module); > throw new SAXException("Fatal Error reading XML on line " + > exception.getLineNumber() + ", column " + exception.getColumnNumber(), > exception); > } > > public void warning(org.xml.sax.SAXParseException exception) throws > org.xml.sax.SAXException { > Debug.logWarning(exception, "Warning reading XML on line " + > exception.getLineNumber() + ", column " + exception.getColumnNumber(), > module); > } > > > Thanks, tej > |
Al Byers wrote:
> Tej, > > I found this link, > http://lists.ofbiz.org/pipermail/users/2005-August/008669.html, by going to > advanced google search and searching on "ofbiz" and "Invalid UTF-8 > Encoding". Or install xmllint. It's in the freeBSD ports collection, so it should be available anywhere. I kept getting this from data that had typgraphic single quotes rather than your normal US-ASCII quotes. -- Walter |
Free forum by Nabble | Edit this page |