发布于 2018-02-25 19:54:23 | 126 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Java函数式编程,程序狗速度看过来!

Java程序设计语言

java 是一种可以撰写跨平台应用软件的面向对象的程序设计语言,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java平台(即JavaEE(j2ee), JavaME(j2me), JavaSE(j2se))的总称。


这篇文章主要介绍了java 解决异常 2 字节的 UTF-8 序列的字节 2 无效的问题的相关资料,需要的朋友可以参考下

java 解决异常 2 字节的 UTF-8 序列的字节 2 无效的问题

         最近做项目,遇到异常 2 字节的 UTF-8 序列的字节 2 无效的问题,上网找了下资料,这里记录下解决方法,有遇到同样问题的大家,可以看下

详细异常:


十二月 08, 2015 7:16:55 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: 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 无效。
 at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
 at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:372)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
 at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:497)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
 at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
 at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
 at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:96)
 at org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:83)
 at org.apache.jasper.compiler.JspConfig.init(JspConfig.java:231)
 at org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:290)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:113)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:365)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:90)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:91)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at com.huaqin.dmt.filter.Acl.doFilter(Acl.java:251)
 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at com.huaqin.dmt.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:38)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)

解决方法:

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

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

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

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!



相关阅读 :
java 解决异常 2 字节的 UTF-8 序列的字节2 无效的问题
Java中异常打印输出的常见方法总结
Java在web页面上的编码解码处理及中文URL乱码解决
使用Eclipse开发工具如何解决Java Compiler中Annotation Processin不出现的问题
Java异常处理中的一些特殊情况举例
详解Java的内置异常以及创建自定义异常子类的方法
Java中异常处理之try和catch代码块的使用
解析Java中未被捕获的异常以及try语句的嵌套使用
解决Java中OutOfMemoryError的问题
浅谈JAVA 异常对于性能的影响
java实现合并2个文件中的内容到新文件中
java执行bat命令碰到的阻塞问题的解决方法
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务