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

Reference: http://wsjiang.iteye.com/blog/1197798

com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence. Error reading XML configuration file. It took a long time to solve the problem, because the configuration information of the plug-in is missing in pom.xml, and the encoding format needs to be specified as UTF-8. After I added a relatively complete plugins to the configuration, the problem was solved. The configuration of the plugin is as follows:

Xml code   Favorite code
  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> 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326244399&siteId=291194637