tomcat启动项目异常: 2 字节的 UTF-8 序列的字节 2 无效。

严重: Servlet.service() for servlet [jsp] in context with path [/test] threw exception [org.apache.jasper.JasperException: XML parsing error on file org.apache.tomcat.util.scan.MergedWebXml] with root cause
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效。


解决方法:

 

在tomcat的bin目录下有文件catalina.bat

找到这行:set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%

在它上一行加入:set JAVA_OPTS=-server -Dfile.encoding=utf-8



版权声明:本文为saindy5828原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。