在 web.xml 配置 org.springframework.web.context.ContextLoaderListener 後,Tomcat 啟動報錯:
Artifact mymaven:war exploded: Error during artifact deployment. See server log for details.
但日志中無明顯異常信息。註釋掉該監聽器則正常運行。
contextConfigLocation 未指定或路徑寫錯,導致找不到 applicationContext.xml。spring-web、spring-context 版本不一致,或缺少 commons-logging 等傳遞依賴。WEB-INF/lib 下 JAR 未隨 WAR 部署。logging.properties 設置 FINE 級別)。web.xml 是否配置 contextConfigLocation:<context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext.xml</param-value></context-param>mvn dependency:tree 檢查 Spring 依賴版本統一。Maven Dependencies。ContextLoaderListener 啟動失敗多由配置路徑、依賴衝突或發布配置引起。建議從日志級別、配置文件、依賴樹、發布路徑四個維度系統排查。