spring裝載配置文件失敗報錯:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException


  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前面有個不起眼的空格。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM