日期:2014-05-18  浏览次数:20738 次

tomcat运行的utf-8问题
mysql.sql已经导入,charset用GBK,设置虚拟目录,运行tomcat,出现如下错误:

2008-6-28 19:58:37 org.apache.catalina.startup.HostConfig deployDescriptor
严重: Error deploying configuration descriptor easyerp.xml
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Inval
id byte 1 of 1-byte UTF-8 sequence.
  at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF
8Reader.java:674)
  at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader
.java:547)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEnti
tyScanner.java:1742)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(
XMLEntityScanner.java:1064)
  at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue
(XMLScanner.java:974)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanAttribute(XMLDocumentFragmentScannerImpl.java:1537)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanStartElement(XMLDocumentFragmentScannerImpl.java:1314)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Conten
tDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1297)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3088)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:914)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:647)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:807)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:737)
  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:107)
  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1205)
  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:522)
  at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1546)
  at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:583)
  at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
ava:553)
  at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488
)
  at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
  at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:293)
  at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:120)
  at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBas
e.java:1306)
  at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1570)
  at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1579)
  at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r
un(ContainerBase.java:1559)
  at java.lang.Thread.run(Thread.java:619)


是什么原因啊?


------解决方案--------------------