An invalid XML character (Unicode: 0x18) was found
今天在除錯解析XML程式的時候,出現瞭如下異常:
org.jdom.input.JDOMParseException: Error on line 18046 of document XX.xml: An invalid XML character (Unicode: 0x18) was found in the CDATA section.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:501)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:928)
at com.zhongsou.apabi.main.XMLImport.readXMLFile(XMLImport.java:111)
at com.zhongsou.apabi.main.XMLImport.main(XMLImport.java:421)
Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x18) was found in the CDATA section.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
結果在google和百度上搜,都沒有好的解決方法,最後自己解決了。
發生原因:資料中出現了非法字元(我這裡顯示是一個小方塊:utf-8編碼),導致jdom解析的時候,不認識這個字元而出錯。
ps:我是通過2分法在檔案中查到的。
希望都發生相同問題的朋友有幫助。
相關文章
- Error parsing XML: An invalid XML character (Unicode:0x1f) was foundErrorXMLUnicode
- An invalid XML character (Unicode: 0x10) was found in the value of attributeXMLUnicode
- An invalid XML character (Unicode: 0x4) was found in the element content of theXMLUnicode
- 微信公眾號 報 An invalid XML character (Unicode: 0x1a) was found in the CDATA sectioXMLUnicode
- All About JAVA An invalid XML character (Unicode: 0xdd65) was found in the comment 錯誤JavaXMLUnicode
- 對XML 進行 parse 時的Invalid Unicode character (0x0) 分析XMLUnicode
- Java - XML字元支援報錯An invalid XML characterJavaXML字元
- SAXParseException An invalid XML character 問題的解決ExceptionXML
- Dom4j 讀 xml 時,遇到 xml 無效字元,報錯:An invalid XML characterXML字元
- IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensExceptionHTTP
- 已解決:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 問題
- Python 錯誤 SyntaxError: invalid character in identifierPythonErrorIDE
- mybatis3:Invalid bound statement (not found)MyBatisS3
- MyBatis 錯誤:Invalid bound statement (not found)MyBatis
- mybatis 報錯: Invalid bound statement (not found)MyBatis
- MySQL Invalid gbk character string 1300MySql
- Invalid bound statement (not found)錯誤解決
- not found service definition in jdonframework.xmlFrameworkXML
- DataPump Export (EXPDP) Fails With Error LPX-216 Invalid CharacterExportAIError
- IDEA+Maven:invalid bound statement (not found)解決辦法IdeaMaven
- error MSB8031 Building an MFC project for a non-Unicode character set is deprecatedErrorUIProjectUnicode
- AL32UTF8 / UTF8 (Unicode) Database Character Set Implications [ID 788156.1]UnicodeDatabase
- Jsp Unescaped xml character報錯的解決辦法JSXML
- xml問題請教:org.xml.sax.SAXParseException: Invalid encoding name "GBK".XMLExceptionEncoding
- PHP 對字串進行十六進位制替換 invalid character in attribute valuePHP字串
- java.sql.SQLException: ORA-00911: invalid character 解決方法(轉)JavaSQLException
- 執行mysqlbinlog出現Found invalid event in binary log錯MySql
- MybatisPlus自帶方法報錯BindingException: Invalid bound statement (not found)MyBatisException
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)ApacheBATException
- 解析XML檔案時,無效的XML 字元 (Unicode: 0x7)異常處理XML字元Unicode
- IDEA+Maven+Springboot:invalid bound statement (not found) 解決辦法IdeaMavenSpring Boot
- 報錯Invalid bound statement (not found): com.thxy.mapper.RoleMapper.insertRleAPP
- 解決:錯誤 1 error MSB8031: Building an MFC project for a non-Unicode character set is deprecatedErrorUIProjectUnicode
- Ubuntu 20.04 安裝 php-xml 模組(報錯:Class 'DOMDocument' not found )UbuntuPHPXML
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): yycg.business.dao.mApacheBATException
- MyBatis繫結錯誤:org.apache.ibatis.binding.BindingException:Invalid bound statement (not found)MyBatisApacheException
- mybatis配置時出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)MyBatisApacheException
- unicodeUnicode