java.lang.IllegalStateException: Error starting child错误的产生与解决
经过网友解惑,
一般原因有:
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类+异常信息)
所以说,要仔细,不能在这些东西上面浪费太多时间。
希望能帮到你!!!
java.lang.IllegalStateException: Error starting child错误的产生与解决相关推荐
- 关于viewpager 里嵌套 listview 同时实现翻页功能的“java.lang.IllegalStateException: The specified child...异常处理...
这几天做项目用到了ViewPager,因为它可以实现左右划动多个页面的效果,然后 再每个页面里使用ListView,运行时总是出现"PagerAdapter java.lang.Illega ...
- 安卓java.lang.IllegalStateException: The specified child already has a parent.解决方案
在使用ViewPager的时候遇到一个错误java.lang.IllegalStateException: The specified child already has a parent. You ...
- 【Neo4j】SOLVED:java.lang.RuntimeException: Error starting Neo4j database server
问题描述:Neo4j 数据库服务启动失败 java.lang.RuntimeException: Error starting Neo4j database server 问题分析:APOC插件问题 ...
- java.lang.IllegalStateException: Error processing condition on com.alibaba.cloud.nacos.discovery.rea
ERROR: java.lang.IllegalStateException: Error processing condition on com.alibaba.cloud.nacos.discov ...
- 访问tomcat出现java.lang.IllegalStateException No output folder错误解决方法
问题:tomcat分为安装版和解压缩版,解压缩版如果解压到安装盘,在浏览器中访问http://localhost:8080,可能会出现500错误,错误提示如下: localhost:8080 jav ...
- 针对异常java.lang.IllegalStateException onMeasure() did not set the measured dimension解决方法
针对异常java.lang.IllegalStateException onMeasure() did not set the measured dimension by calling setMea ...
- iBatis报java.lang.RuntimeException: Error setting property错误
通过检查,发现数据库中此列数据为空,但实际数据库设置此字段属性为int类型,默认值为0,当查询转换时,不能把null转换成int类型,如此就产生了异常,如果实际应用中确实有空的数据,但需转换成其他类型 ...
- tomcat发布应用报错Error starting child
使用tomcat发布应用程序是报错: SEVERE [main] org.apache.catalina.startup.HostConfig.deployDirectory Error deploy ...
- java match parent_java.lang.IllegalStateException: The specified child already has a parent
问题 I am using fragments, when I instantiate a fragment the first time it it. but the second time I g ...
最新文章
- 使用java9的uuid生成方式,让uuid生成速度提升一个档次...
- angular.js phonecat翻译
- 在每天下午5点使用计算机时,网络信息安全知识网络竞赛试题(附答案)讲解学习...
- 机器学习(三十)——Model-Free Control
- php mysql 连接类_深入理解php的MySQL连接类
- 【Spark-core学习之六】 Spark资源调度和任务调度
- 系统学习深度学习(十七)--VGG模型
- 【t092】迷之阶梯
- wireshark检测iphone-ios是否感染XcodeGhost病毒
- vivado 开发教程(一) 创建新硬件工程
- 苹果将30天无条件退还iPhone改为14天
- Audio Hijack Pro 3.7.4 录制应用程序内播放的声音
- 漫谈程序员系列 薪资,你是我不能言说的伤
- 超级授权专业版 SuperSU Pro v2.68 简体中文版
- 如何伪装成一个服务端开发(五)
- Java大牛给初学者的学习路线建议
- pandas实现列转行
- java桌面端开发为什么没就行起来,大部分人选qt,winform,electron?
- CodeForces - 777D Cloud of Hashtags
- 565 数组嵌套(图论思想-求解所有环的最大长度)
热门文章
- LTP(LinuxTest Project)测试工具
- A. 本地DNS服务器的位置
- python_day6 shutil模块
- [BZOJ 1047] [HAOI2007] 理想的正方形 【单调队列】
- 用CURD来拯救前端的一切的一切
- RabbitMQ introduction
- IE的2像素偏差问题终于“将要”成为历史了(附js微技巧一则)
- 软件测试作业8:分析自动售货机软件例子生成的判定表图例
- C# 基础知识 (四).C#简介及托管代码
- HarmonyOS之JS/Java跨语言调试