查看tomcat路径下logs目录下的项目启动日志,发现报错;
main ERROR SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would not have initialized.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 58 in XML document from ServletContext resource [/WEB-INF/spring-configuration/redisDataSource.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 58; columnNumber: 13; The string “–” is not permitted within comments.
经过排查发现是项目的配置文件**.xml中某个节点注释后,在其中又嵌套了一个注释,就是下面这样:
<!--
<!-- -->
-->
导致XML文件解析错误,所以访问不到项目.