今天我用了近一天的时间研究一个错误,早上写代码是遇到一个 错误严重错误代码如下:

  1. 严重: ContainerBase.addChild: start:
  2. org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/201110181]]
  3. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
  4. at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
  5. at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
  6. at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
  7. at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
  8. at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
  9. at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
  10. at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
  11. at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
  12. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  13. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  14. at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
  15. at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
  16. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
  17. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
  18. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  19. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
  20. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
  21. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  22. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
  23. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  24. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
  25. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  26. at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
  27. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  28. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  29. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  30. at java.lang.reflect.Method.invoke(Method.java:597)
  31. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
  32. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
  33. Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name fDemoServlet
  34. at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3151)
  35. at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3130)
  36. at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1301)
  37. at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1390)
  38. at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896)
  39. at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322)
  40. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  41. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  42. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
  43. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  44. ... 29 more
  45. 2011-10-18 15:21:19 org.apache.catalina.startup.HostConfig deployDirectory
  46. 严重: Error deploying web application directory 201110181
  47. java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/201110181]]
  48. at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:816)
  49. at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
  50. at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
  51. at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
  52. at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
  53. at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
  54. at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
  55. at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
  56. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  57. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  58. at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
  59. at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
  60. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
  61. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
  62. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  63. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
  64. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
  65. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  66. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
  67. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  68. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
  69. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
  70. at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
  71. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  72. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  73. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  74. at java.lang.reflect.Method.invoke(Method.java:597)
  75. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
  76. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)

错误分别是 :

org.apache.catalina.LifecycleException:

java.lang.IllegalArgumentException:

java.lang.IllegalStateException:

这三个错误原来见过,但是没有记住,今天让这三个错误纠结了我一天 现在我将错误的产生的原因给大家做个总结

现在正在学习 Servlet 我建立了三个文件 第一个文件Java文件

通过 New ----> Servlet 创建的 DemoServlet.java

  1. package cn.cdn.web.servlet;
  2. import java.io.IOException;
  3. import java.io.PrintWriter;
  4. import javax.servlet.ServletException;
  5. import javax.servlet.http.HttpServlet;
  6. import javax.servlet.http.HttpServletRequest;
  7. import javax.servlet.http.HttpServletResponse;
  8. public class DemoServlet extends HttpServlet {
  9. public void doGet(HttpServletRequest request, HttpServletResponse response)
  10. throws ServletException, IOException {
  11. this.doPost(request, response);
  12. }
  13. public void doPost(HttpServletRequest request, HttpServletResponse response)
  14. throws ServletException, IOException {
  15. /*设置编码*/
  16. request.setCharacterEncoding("UTF-8");
  17. System.out.println("==========-----------=============");
  18. }
  19. }

然后生成的 xml :web.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app version="2.5"
  3. xmlns="http://java.sun.com/xml/ns/javaee"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  6. http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  7. <display-name></display-name>
  8. <servlet>
  9. <description>This is the description of my J2EE component</description>
  10. <display-name>This is the display name of my J2EE component</display-name>
  11. <servlet-name>DemoServlet</servlet-name>
  12. <servlet-class>cn.cdn.web.servlet.DemoServlet</servlet-class>
  13. </servlet>
  14. <servlet-mapping>
  15. <servlet-name>DemoServlet</servlet-name>//如果这里的名字定义错误 就会出现上面的错误!
  16. <url-pattern>/demo.do</url-pattern>
  17. </servlet-mapping>
  18. <welcome-file-list>
  19. <welcome-file>index.jsp</welcome-file>
  20. </welcome-file-list>
  21. </web-app>

原因很简单,就是名字他找不到,所以就会报错,至于怎么解释我不清楚总之如果遇到这个错误大家就去这个地方找就行了

web.xml 中的 <servlet-name>DemoServlet</servlet-name>

<url-pattern>/demo.do</url-pattern>

看看是不是能解决!

Failed to start component [StandardEngine[Catalina].StandardHost[localhost....的更多相关文章

  1. Tomcat报错:Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]

    Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] 解决办法: 1,检测你的web.xml.去掉所 ...

  2. Tomcat启动时报错,Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext

    05-Dec-2016 11:23:44.321 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addCh ...

  3. Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/***]]

    问题描述:Tomcat容器和Eclipse启动运行时候报错 Failed to start component [StandardEngine[Catalina].StandardHost[local ...

  4. Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringStruts]]

    今天启动Tomcat时候遇到了这个问题 Failed to start component [StandardEngine[Catalina].StandardHost[localhost].Stan ...

  5. Tomcat启动出现:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvc]]解决办法

    严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component ...

  6. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext

    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start com ...

  7. 关于Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springmvc-demo-01-start]]出错的解决方法

    出错的详情: 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache ...

  8. Failed to start component [StandardEngine [Catalina].StandardHost[localhost].StandardContext[/项目名]]

    问题: 最近几天在做一个小项目,今天中午本来想启动tomcat打开看看项目的,没想到项目突然无法打开,页面总是显示404 tomcat报错如下:Failed to start component [S ...

  9. tomcat启动时错误:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误

    今天第一次遇到Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误,并且在错误提示的后半段出现了 ...

随机推荐

  1. 认真学习shell的第一天-数学运算

    shell中的数学运算有三种方式: (1)let,用let的时候,变量名称前不用添加$ (2)[],[]中变量可使用也可不使用$ (3)(())变量名之前必须添加$

  2. $.getJSON异步请求和同步请求

    先说一下我遇到的问题吧,我之前的一个函数想调用上一个函数的返回值,但是它的返回值一直为空,后来翻了一些资料才明白是异步请求在作怪,不多说,看例子,这是我之前有返回值函数的代码: function ge ...

  3. paper 43 :ENDNOTE下载及使用方法简介

    转载来源:http://blog.sciencenet.cn/blog-484734-367968.html 软件下载来源: EndNote v9.0 Final 正式版:http://www.ttd ...

  4. linux更新系统之后,删除多余的开机启动项

    实验环境是centos7,采用uefi的引导方式,启动管理软件是grub2 1. 进入 /boot 目录,应该可以发现许多文件的文件名是以 vmlinuz 开头,后面跟着版本信息,这些就是内核.我们要 ...

  5. (function($){...})(jQuery) 函数详解

    function(arg){...} 这是一个匿名函数,参数是arg. 而调用匿名函数时,是在函数后面写上括号和实参的,由于操作符的优先级,函数本身也需要用括号,即: function(arg){.. ...

  6. 膜拜acm大牛 虽然我不会这题,但是AC还是没有问题的~(转自hzwer)

    wywcgs: 亦称Lord Wu,俗名吴垠,2009级厦门大学智能科学与技术学院研究生,本科就读于哈尔滨工业大学.因其深厚的算法功底与独到的思维方式,被尊为“吴教主”,至今声威犹存. 2006年起参 ...

  7. 什么是BI(Business Intelligence)【转】

    谈谈对BI的理解,从BI的定义.基本技术.专业名词.实例应用及扩展等方面进行重新描述,巩固对BI的理解. 一.BI的定义 BI是Business Intelligence的英文缩写,中文解释为商务智能 ...

  8. Android多线程通信之Handler

    主线程 public class MainActivity extends ActionBarActivity { private Handler handler; // private Thread ...

  9. android 项目学习随笔二十一(IM、语音识别、机器人、统计、扫描二维码、条形码)

    语音识别:科大讯飞语音云 http://www.xfyun.cn/ 语音机器人模拟 public class TalkBean { public String text; public boolean ...

  10. Java ActiveMQ 讲解(一)理解JMS 和 ActiveMQ基本使用(转)

    转自:http://www.cnblogs.com/luochengqiuse/p/4678020.html?utm_source=tuicool&utm_medium=referral 最近 ...