zoukankan      html  css  js  c++  java
  • Invalid byte 2 of 2byte UTF8 sequence解决方案

    异常信息如下:

    2009-9-14 3:56:54 org.apache.catalina.startup.Catalina stopServer   
    严重: Catalina.stop:    
    com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.   
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)   
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)   
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)   
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)   
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)   
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)   
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)   
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)   
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:410)   
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   
        at java.lang.reflect.Method.invoke(Unknown Source)   
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)   
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) 

    解决方案如下:

    方案1

    检查tomcat里面的配置文件中有没有使用汉字(包括注释),有汉字则把汉字改成英文

    方案2

    在有汉字的配置文件中,加入如下代码

    <?xml version="1.0" encoding="gbk"?>

  • 相关阅读:
    WPF 创建自定义窗体
    Entity Framework Code First for SQL Compact
    WPF QuickStart系列之样式和模板(Style and Template)
    WPF 实现 DataGrid/ListView 分页控件
    WPF ItemsControl ListBox ListView比较
    WPF 实现带标题的TextBox
    WPF ListView展示层叠信息
    上(下)三角矩阵
    正定矩阵(positive definite matrix)
    (非)奇异矩阵
  • 原文地址:https://www.cnblogs.com/balaamwe/p/2383413.html
Copyright © 2011-2022 走看看