Tomcat容器啟動失敗,找到 debug日志一看:
Context initialization failed
org.springframework. beans.factory.xml.XmlBeanDefinitionStoreException:Line 1 in XML document from file [spring-wlf.xml] is invalid;nested exception is org.xml.sax.SAXParseException:The processing instruction target matching "[xX][mM][1L]” is not allowed.
回頭打開spring-wlf.xml仔細看了下
<?xml version="1.0" encoding="UTF-8"?>
竟然在文件開頭多了一個空格,導致識別不了文件。不得不承認,有時候問題就是這么糾結而細微:在<?xml前面有個不起眼的空格。