編碼問題Invalid byte 3 of 3-byte UTF-8 sequence.


1.Configuration problem: Failed to import bean definitions from URL location [classpath:spring/*Bean.xml]

2.Parsing XML document from file [D:\Program Files (x86)\Tomcat1\webapps\kissflovewebsite

\WEB-INF\classes\spring\NormalBean.xml];

 nested exception is java.io.UTFDataFormatException: Invalid byte 3 of 3-byte UTF-8 sequence.

出現這個異常無非是編碼問題,可以按下面步驟依次排除異常:

1、檢查拋錯的那個xml文件,查看里面是否有中文,有中文把中文刪掉是可以解決問題的。

2、如果中文是有用不能刪的內容,那可以把<?xml version="1.0" encoding="UTF-8"?>改成<?xml version="1.0" encoding="gbk"?>

3.BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

這里其實可以看出是bean配置文件出了問題、在向上觀察、是編碼出現問題、依上解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM