日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java.lang.IllegalStateException: Error starting child错误的产生与解决

發(fā)布時間:2024/4/18 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java.lang.IllegalStateException: Error starting child错误的产生与解决 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

經(jīng)過網(wǎng)友解惑,
一般原因有:

1,jar版本不一致

2,servlet配置重復(xml+注解)

3,servlet配置映射少了‘/’,(路徑錯誤)

嚴格意義上我的錯誤是屬于第3種,

錯在哪呢?

你們看:

<!-- 請求錯誤響應配置--><error-page><error-code>404</error-code><location>error.html</location></error-page>

在說明一點:我的error.html在WEB-INF目錄下。

我們來分析打印的錯誤(最后一個):

Caused by: java.lang.IllegalArgumentException: Error page location [error.html] must start with a '/'at org.apache.catalina.core.StandardContext.addErrorPage(StandardContext.java:2930)at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1280)at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1169)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5048)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)... 44 more Error page location [error.html] must start with a '/'

顯而易見,是元素中路徑配置出錯,改成:

<!-- 請求錯誤響應配置--><error-page><error-code>404</error-code><location>/WEB-INF/error.html</location></error-page>

不要忘記加/
(類似錯誤一定要仔細檢查xml與servlet類+異常信息)
所以說,要仔細,不能在這些東西上面浪費太多時間。

希望能幫到你!!!

總結(jié)

以上是生活随笔為你收集整理的java.lang.IllegalStateException: Error starting child错误的产生与解决的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。