一、前言
关于通过mycat配置mysql分库分表配置(详细配置教程参考其他文章页面)时启动,打开faused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。
.."错误异常,详情日志如下>>
INFO | jvm 1 | 2019/05/12 21:18:20 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at io.mycat.config.util.ConfigUtil.getDocument(ConfigUtil.java:115)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:111)@b@INFO | jvm 1 | 2019/05/12 21:18:20 | ... 13 more@b@STATUS | wrapper | 2019/05/12 21:18:22 | <-- Wrapper Stopped@b@STATUS | wrapper | 2019/05/12 21:21:43 | --> Wrapper Started as Daemon@b@STATUS | wrapper | 2019/05/12 21:21:43 | Launching a JVM...@b@INFO | jvm 1 | 2019/05/12 21:21:43 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0@b@INFO | jvm 1 | 2019/05/12 21:21:43 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org@b@INFO | jvm 1 | 2019/05/12 21:21:43 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.@b@INFO | jvm 1 | 2019/05/12 21:21:43 | @b@INFO | jvm 1 | 2019/05/12 21:21:44 | @b@INFO | jvm 1 | 2019/05/12 21:21:44 | WrapperSimpleApp: Encountered an error running main: java.lang.ExceptionInInitializerError@b@INFO | jvm 1 | 2019/05/12 21:21:44 | java.lang.ExceptionInInitializerError@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.MycatStartup.main(MycatStartup.java:53)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at java.lang.reflect.Method.invoke(Method.java:498)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at java.lang.Thread.run(Thread.java:748)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | Caused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:121)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:78)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:82)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.ConfigInitializer.<init>(ConfigInitializer.java:76)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.MycatConfig.<init>(MycatConfig.java:72)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.MycatServer.<init>(MycatServer.java:158)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.MycatServer.<clinit>(MycatServer.java:101)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | ... 7 more@b@INFO | jvm 1 | 2019/05/12 21:21:44 | Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(XMLScanner.java:746)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(XMLDocumentFragmentScannerImpl.java:1014)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(XMLScanner.java:714)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:907)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.util.ConfigUtil.getDocument(ConfigUtil.java:115)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:111)@b@INFO | jvm 1 | 2019/05/12 21:21:44 | ... 13 more@b@STATUS | wrapper | 2019/05/12 21:21:46 | <-- Wrapper Stopped
二、解决方法
打开mycat的conf目录修改schema.xml等xml配置文件,保证XML文件的第一个元素前面不能空格(也就是保证第一个元素是 <?xml version="1.0" encoding="UTF-8"?>开头,规范的XML格式),在重启问题即可解决了