tomcat启动异常 报错"Parse Fatal Error"和"org.xml.sax.SAXParseException"解决办法
tomcat启动异常,报出错误:
Parse Fatal Error at line 1 column 31: bad continuation of multi-byte UTF-8 sequence (character code: 0xffffffd4)
org.xml.sax.SAXParseException: bad continuation of multi-byte UTF-8 sequence (character code: 0xffffffd4)等。
分析:
首先出现xml.sax.SAXParseException问题,tomcat启动出错。就猜测问题可能出现在web.xml。
1.查看web.xml的格式是否正确,包括标签等是否完全对应上,以及各个标签的顺序是否关联上。
2.查看web.xml文件中是否有特殊的字符,如中文逗号,空格,顿号,冒号等。
3.看jar包是否重复添加或jar包版本有冲突。
上面几项都调查正确后,清掉work目录下的文件,重新启动Tomcat,一般就可以成功的运行tomcat了。
下面附上一段web.xml出错时,tomcat的打印信息:
严重: Parse Fatal Error at line 1 column 31: bad continuation of multi-byte UTF-8 sequence (character code: 0xffffffd4)
org.xml.sax.SAXParseException: bad continuation of multi-byte UTF-8 sequence (character code: 0xffffffd4)
?at gnu.xml.aelfred2.SAXDriver.fatal(SAXDriver.java:911)
?at gnu.xml.aelfred2.XmlParser.error(XmlParser.java:391)
?at gnu.xml.aelfred2.XmlParser.encodingError(XmlParser.java:4471)
?at gnu.xml.aelfred2.XmlParser.getNextUtf8Byte(XmlParser.java:4323)
?at gnu.xml.aelfred2.XmlParser.copyUtf8ReadBuffer(XmlParser.java:4232)
?at gnu.xml.aelfred2.XmlParser.readDataChunk(XmlParser.java:4107)
?at gnu.xml.aelfred2.XmlParser.readCh(XmlParser.java:3197)
?at gnu.xml.aelfred2.XmlParser.skipWhitespace(XmlParser.java:2089)
?at gnu.xml.aelfred2.XmlParser.parseMisc(XmlParser.java:773)
?at gnu.xml.aelfred2.XmlParser.parseProlog(XmlParser.java:519)
?at gnu.xml.aelfred2.XmlParser.parseDocument(XmlParser.java:414)
?at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:167)
?at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)
?at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)
?at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
?at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
?at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
?at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
?at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
?at org.apache.catalina.core.StandardContext.start(StandardContext.java:4339)
?at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1173)
?at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
?at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
?at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
?at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
?at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
?at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
?at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
?at java.lang.Thread.run(Unknown Source)