MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence

com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence. 读取XML配置文件出错。搞了很久才将问题解决,是由于pom.xml中缺少插件的配置信息,编码格式需要指明为UTF-8.我将一个比较完整的plugins加入到配置中后,问题解决。插件的配置内容如下:

Xml代码  MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence
  1. <plugins>  
  2.             <plugin>  
  3.                 <groupId>org.apache.maven.plugins</groupId>  
  4.                 <artifactId>maven-compiler-plugin</artifactId>  
  5.                 <configuration>  
  6.                     <source>1.6</source>  
  7.                     <target>1.6</target>  
  8.                     <encoding>UTF-8</encoding>  
  9.                 </configuration>  
  10.             </plugin>  
  11.             <plugin>  
  12.                 <groupId>org.apache.maven.plugins</groupId>  
  13.                 <artifactId>maven-war-plugin</artifactId>  
  14.                 <version>2.1.1</version>  
  15.                 <configuration>  
  16.                     <warSourceExcludes>${warExcludes}</warSourceExcludes>  
  17.                 </configuration>  
  18.             </plugin>  
  19.             <plugin>  
  20.                 <groupId>org.apache.maven.plugins</groupId>  
  21.                 <artifactId>maven-surefire-plugin</artifactId>  
  22.                 <version>2.4.3</version>  
  23.                 <configuration>  
  24.                     <testFailureIgnore>true</testFailureIgnore>  
  25.                 </configuration>  
  26.             </plugin>  
  27.             <plugin>  
  28.                 <inherited>true</inherited>  
  29.                 <groupId>org.apache.maven.plugins</groupId>  
  30.                 <artifactId>maven-source-plugin</artifactId>  
  31.                 <executions>  
  32.                     <execution>  
  33.                         <id>attach-sources</id>  
  34.                         <goals>  
  35.                             <goal>jar</goal>  
  36.                         </goals>  
  37.                     </execution>  
  38.                 </executions>  
  39.             </plugin>  
  40.             <plugin>  
  41.                 <groupId>org.apache.maven.plugins</groupId>  
  42.                 <artifactId>maven-resources-plugin</artifactId>  
  43.                 <configuration>  
  44.                     <encoding>UTF-8</encoding>  
  45.                 </configuration>  
  46.             </plugin>  
  47.         </plugins>