<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插件的编码设置。

maven filter 乱码,MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.的更多相关文章

  1. 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 ...

  2. MalformedByteSequenceException: Invalid byte 1 of 1-byte

    修改了线上程序的xml配置文件,重启后报如下错误: MalformedByteSequenceException: Invalid byte 1 of 1-byte 百度了下大体的意思是说文件的编码错 ...

  3. maven filter插件只替换了部分变量问题

    maven filter简介 maven的resources插件,有一个filter的作用,能够在打包的时候,从特定文件里读取key-value对,替换配置文件中的占位符变量.很多线上线下有不同环境的 ...

  4. Maven Filter与Profile隔离生产环境与开发环境

    Maven Filter与Profile隔离生产环境与开发环境 在不同的开发阶段,我们一般用到不同的环境,开发阶段使用开发环境的一套东西,测试环境使用测试环境的东西,可能有多个测试环境,生产环境使用的 ...

  5. 【python】python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte sequence

    python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte ...

  6. java int转byte和long转byte

    在网络编程中,出于节约带宽或者编码的需要,通常需要以原生方式处理long和int,而不是转换为string. public class ByteOrderUtils { public static b ...

  7. 【转】java中byte, int的转换, byte String转换

    原文网址:http://freewind886.blog.163.com/blog/static/661924642011810236100/ 最近在做些与编解码相关的事情,又遇到了byte和int的 ...

  8. java 乱码详解_jsp中pageEncoding、charset=UTF -8"、request.setCharacterEncoding("UTF-8")

    http://blog.csdn.net/qinysong/article/details/1179480 java 乱码详解__jsp中pageEncoding.charset=UTF -8&quo ...

  9. python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence

    python读取文件时提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal m ...

随机推荐

  1. kettle系列-kettle管理平台部署说明

    本介绍我的开源项目[kettle-manager]kettle管理平台如何获取并部署使用,该项目介绍请参看另一篇博文:http://www.cnblogs.com/majinju/p/5739820. ...

  2. Xcode最好用的日志打印方法

    一般打印日志都是用的系统自带的NSLog来打印的,假如项目做完了,要上线了,这些打印的日志就会很浪费性能,网上有很多的解决办法,我也是感觉网上的还是有点不方便,所以就自己又修改了一下,分享给大家. 网 ...

  3. Denormalization

    Denormalization In computing, denormalization is the process of attempting to optimize the read perf ...

  4. Linux内核:kthread_create(线程)、SLEEP_MILLI_SEC

    转自:http://blog.csdn.net/guowenyan001/article/details/39230181 一.代码 #include <linux/module.h> # ...

  5. Python-面向对象(类)二

    一.成员修饰符 • 共有成员 • 私有成员 __+字段 __:成员修饰符 无法直接访问,只能通过该成员所属类的方法简介访问 class Foo: def __init__(self, name, ag ...

  6. collection of vim vim tutorial for beginner

    在linux命令行下编辑文档 http://blog.csdn.net/niushuai666/article/details/7275406 http://linuxconfig.org/vim-t ...

  7. Go语言 模板的使用(一)

    使用Parse package main import ( "html/template" "net/http" ) func SayHello(w http. ...

  8. python遍历一个网段的ip地址

    def ip2num(ip):#ip to int num lp = [int(x) for x in ip.split('.')] return lp[0] << 24 | lp[1] ...

  9. Node.js之创建应用

    1.使用Node.js时,不仅仅在实现一个应用,同时实现了整个HTTP服务器: 2.Node.js由下列几部分组成: (1)引入required模块:我们可以使用require指令来载入Node.js ...

  10. windows 常用命令整合--脚本工具

    到年终了,手里活不多了,平时就想着将平时一些常用的命令整合一下,于是下面的一个小小脚本就出来了... 好了,直接上菜:(http://files.cnblogs.com/files/hsuchan/c ...