1. 程式人生 > >Tomcat異常:server Tomcat v9.09 Server at localhost failed to start

Tomcat異常:server Tomcat v9.09 Server at localhost failed to start

localhost ron 尋找 代碼 pattern host child bubuko image

詳細報錯:

技術分享圖片

首先不要慌張,這不是Tomcat引發的問題。而是你自己代碼錯誤導致的問題(小編遇到的是配置servlet-mapping時,url-pattern中配置不合法)

然後,檢查控制臺打印信息,尋找caused by部分。

果然,小編找到一條:

Caused by: org.apache.catalina.LifecycleException: A child container failed during start

以及:

嚴重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start

似乎,找到了錯誤,但是很遺憾,這也不是錯誤產生的原因。

提示:A child container failed during start 從來都不是問題的根本原因!

繼續向上尋找。

小編的錯誤找到了:

Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> doLogin in servlet mapping

最終原因是,在配置<url-pattern>標簽是在doLogin前面少寫了一個反斜杠。

參考博客:http://blog.csdn.net/testcs_dn/article/details/41824497

Tomcat異常:server Tomcat v9.09 Server at localhost failed to start