xml 3 字节的 UTF-8 序列的字节 3 无效
今天在eclipse中编写**.xml文件时,注释中的中文被eclipse识别到错误:3 字节的 UTF-8 序列的字节 3 无效,曾多次遇到该问题,问题的根源是:
The cause of this is a file that is not UTF-8 is being parsed as UTF-8. It is likely that the parser is encountering a byte value in the range FE-FF. These values are invalid in the UTF-8 encoding.
但这次很诡异,我使用notepad++将pom.xml的编码保存为“UTF-8无BOM”形式,pom.xml文件内的encoding属性设置为“UTF-8”,问题依旧啊,郁闷了,难道上述的理论有问题?还是eclipse的bug呢?在网上看了半天,基本都是这么说的。
第一,可以直接在XML文件中更改UTF-8为GBK或GB2312
<?xml version="1.0" encoding="GB2312"?>
第二,可以在Eclipse中更改,在 eclipse 的功能表 [Project]→[Properties],點選 [Resources],在右邊的「Text file encoding」,把原來是系統預設的編碼,改為 「UTF-8」
但是考虑到不能改成GB类的编码,所以把xml的encoding属性值UTF-8改为UTF8就可以了
实际操作的时候,发现XML配置文件太多,不可能一个个改,在一个之前是正常的,所以这种方案放弃,最终解决为设置spelling编码及workspace编码,然后将项目删除重新导入,正常
如果还不行,POM文件添加编译编码
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

xml 3 字节的 UTF-8 序列的字节 3 无效的更多相关文章
- eclipse xml 编码问题 “3 字节的 UTF-8 序列的字节 3 无效”
原本项目没问题,git commit之后,突然报错 “3 字节的 UTF-8 序列的字节 3 无效” 尝试过改xml文件编码等,没成功.pom中设置属性,成功解决 <project.build. ...
- Xml解析过程中遇到“” 1 字节的 UTF-8 序列的字节 1 无效“”问题---idea与eclipse同适用
转载自:http://blog.csdn.net/zhangzhikaixinya/article/details/7727938 今天在eclipse中编写pom.xml文件时,识别到错误:Inva ...
- XML文件存在中文注释报错问题( 3 字节的 UTF-8 序列的字节 3 无效)
今天在做mybatis项目的时候,给映射文件添加了中文注释后,程序就报错.把中文注释删除后,程序又可以正常执行.解决方法在下文提到. 我的xml映射文件如下: <?xml version=&qu ...
- Error building SqlSession. ### The error may exist in dao/UserMapper.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration(2 字节的 UTF-8 序列的字节 2 无效。)
关于在学习Mybatis框架时运行报错 Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building ...
- org.dom4j.DocumentException : 1 字节的 UTF-8 序列的字节 1 无效。 Nested exception: 1 字节的 UTF-8 序列的字节 1 无效。
org.dom4j.DocumentException : 1 字节的 UTF-8 序列的字节 1 无效. Nested exception: 1 字节的 UTF-8 序列的字节 1 无效. 网上查了 ...
- JAVA中遇到 UTF-八 序列的字节 1 无效
UTF-8 序列的字节 1 无效用dom4j操作xml文件, 出现了这个错误.原因是xml文件被创建的时候是ansi码格式. ( UTF-8 序列的字节 1 无效用dom4j操作xml文件, 出现 ...
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document fro ...
- Maven 项目 启动时 解决3 字节的 UTF-8 序列的字节 3 无效
"org.activiti.bpmn.exceptions.XMLException: 3 字节的 UTF-8 序列的字节 3 无效." Maven 项目启动时,由于读XML配置文 ...
- 3 字节的 UTF-8 序列的字节 2 无效
由于目前写完了[消息队列]模块,想做个单元测试,所以就利用spring的import标签,将mq的配置文件加入了配置.结果出现了<3 字节的 UTF-8 序列的字节 2 无效>这个问题. ...
随机推荐
- python应用-n颗骰子的和出现的次数
from random import randint def roll_dice(n): total=0 for _ in range (n): num=randint(1,6) total+=num ...
- cmds jdbc连接写法
格式一: Oracle JDBC Thin using a ServiceName: jdbc:oracle:thin:@//<host>:<port>/<servic ...
- node 文件上传
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- ava js 测试框架基本试用
随着js 越来越强大,日常使用中关于js 的问题也就越突出了,我们需要关注的点也就不能只像以前那样 只编写简单的功能实现,我们同时也需要关注js 的健壮性,测试就是其中一个比较重要的环节,以下 是av ...
- Reactive Extensions (Rx) 入门(4) —— Rx的事件编程
译文:https://blog.csdn.net/fangxing80/article/details/7685393 原文:http://www.atmarkit.co.jp/fdotnet/int ...
- 插入排序;至少要比较N(N-1)/2次;N表示元素个数
<script type="text/javascript"> //冒泡排序:至少要比较N(N-1)/2次:N表示元素个数 function get(){ var nu ...
- 关于C++中extern的简单笔记
extern可以实现多文件共享同一个变量.const常量.函数. 下面结合几个例子来讲一下extern的相关性质(下述皆为多文件编译): 例1: //file1.cpp #include<ios ...
- limma 包
limma:Linear Models for Microarray and RNA-Seq Data http://www.bioconductor.org/packages/release/bio ...
- Centos7 配置静态IP并使用xshell远程连接
静态IP配置 1.定位到 /etc/sysconfig/network-scripts文件夹,打开文件夹下面的ifcfg-enp3s0文件 2.修改BOOTPROTO=static ONBOOT=y ...
- Incorrect string value: 'è·å...' for column 'result' at row 1
错误详情信息: ### Error updating database. Cause: java.sql.SQLException: Incorrect ### The error may invol ...