关闭Tomcat时出错

时间:2011-07-18 18:14:52

标签: tomcat

当我关闭Tomcat时,我收到以下错误,我不确定如何修复它:

[root@jaws bin]# shutdown.sh
Using CATALINA_BASE:   /usr/share/apache-tomcat-7.0.16
Using CATALINA_HOME:   /usr/share/apache-tomcat-7.0.16
Using CATALINA_TMPDIR: /usr/share/apache-tomcat-7.0.16/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/share/apache-tomcat-7.0.16/bin/bootstrap.jar:/usr/share/apache-tomcat-7.0.16/bin/tomcat-juli.jar
Jul 18, 2011 9:03:47 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:554)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(XMLEntityScanner.java:1492)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1533)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:436)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:352)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

1 个答案:

答案 0 :(得分:2)

在关闭Tomcat期间,方法org.apache.catalina.startup.Catalina.stopServer(Catalina.java:436)正在读取conf/server.xml文件。 错误本身是由解析器尝试解析非utf8格式的文件引起的。

你最有可能

<?xml version='1.0' encoding='utf-8'?>

位于server.xml文件的顶部,但有人编辑了该文件(可能在Windows应用程序中)并使其符合非utf8标准。尝试确定文件的编码方式,确保文件中包含所有符合UTF-8标准的字符,或者将文件顶部的声明更改为使用的编码。