编码问题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配置文件出了问题、在向上观察、是编码出现问题、依上解决

posted @ 2017-02-16 11:18  L-小太阳  阅读(7377)  评论(0编辑  收藏  举报