maven filter 乱码,MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.
2014-12-12 15:29
399 查看
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1-beta-1</version> <configuration> <warName>admingift</warName> <webResources> <resource> <directory>${basedir}/src/main/webapp/WEB-INF</directory> <includes> <include>*.xml</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> <targetPath>WEB-INF</targetPath> </resource> <!-- 本地的jar拷贝到lib下 --> <resource> <directory>../lib</directory> <includes> <include>*.jar</include> <include>**/*.jar</include> </includes> <targetPath>WEB-INF/lib</targetPath> </resource> </webResources> <webappDirectory>target/admingift</webappDirectory> </configuration> </plugin>
上面是我maven的war插件的配置。
被wart filter之后就出现了乱妈,启动报错。MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.
大概注意的点是:
1、查看被fitler的文件是否带utf-8的Bom头,去掉bom头,带了有可能报错
2、windows maven的war插件的版本,2.1-bata-1有问题,它的编码识别有问题,怀疑是按照iso-5589-1解析,fitler后的文件16进制查看为3f,造成黑洞现象
3、网上很多解决方式是改成gbk,这个是一种解决方案,如果希望继续使用utf-8编码的,请修改war的filter,还有不要忘记resource插件的编码设置。
相关文章推荐
- Xml:MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence问题原因,以及解决方案
- Xml:MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence. 分类: XML Java 2014-12-14 10:30 150人阅读 评论(0) 收藏
- Android 编译 发生 MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence
- Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence报错解决方法
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:Invalid byte 3 of 3-byte U
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- MalformedByteSequenceException: Invalid byte 1 of 1-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:Invalid byte 2 of 2-byte