Failed to start component [StandardEngine[Catalina].StandardHost[localhost....
今天我用了近一天的时间研究一个错误,早上写代码是遇到一个 错误严重错误代码如下:
- 严重: ContainerBase.addChild: start:
- org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/201110181]]
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
- at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
- at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
- at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
- at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
- at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
- at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
- at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
- at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
- at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
- at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:597)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
- Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name fDemoServlet
- at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3151)
- at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3130)
- at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1301)
- at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1390)
- at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896)
- at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
- at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
- at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- ... 29 more
- 2011-10-18 15:21:19 org.apache.catalina.startup.HostConfig deployDirectory
- 严重: Error deploying web application directory 201110181
- java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/201110181]]
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:816)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
- at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
- at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
- at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
- at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
- at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
- at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
- at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
- at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
- at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
- at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:597)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
- 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
- package cn.cdn.web.servlet;
- import java.io.IOException;
- import java.io.PrintWriter;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- public class DemoServlet extends HttpServlet {
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- this.doPost(request, response);
- }
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- /*设置编码*/
- request.setCharacterEncoding("UTF-8");
- System.out.println("==========-----------=============");
- }
- }
然后生成的 xml :web.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <display-name></display-name>
- <servlet>
- <description>This is the description of my J2EE component</description>
- <display-name>This is the display name of my J2EE component</display-name>
- <servlet-name>DemoServlet</servlet-name>
- <servlet-class>cn.cdn.web.servlet.DemoServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>DemoServlet</servlet-name>//如果这里的名字定义错误 就会出现上面的错误!
- <url-pattern>/demo.do</url-pattern>
- </servlet-mapping>
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- </web-app>
原因很简单,就是名字他找不到,所以就会报错,至于怎么解释我不清楚总之如果遇到这个错误大家就去这个地方找就行了
web.xml 中的 <servlet-name>DemoServlet</servlet-name>
<url-pattern>/demo.do</url-pattern>
看看是不是能解决!
Failed to start component [StandardEngine[Catalina].StandardHost[localhost....的更多相关文章
- Tomcat报错:Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] 解决办法: 1,检测你的web.xml.去掉所 ...
- 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 ...
- Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/***]]
问题描述:Tomcat容器和Eclipse启动运行时候报错 Failed to start component [StandardEngine[Catalina].StandardHost[local ...
- Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringStruts]]
今天启动Tomcat时候遇到了这个问题 Failed to start component [StandardEngine[Catalina].StandardHost[localhost].Stan ...
- Tomcat启动出现:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvc]]解决办法
严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component ...
- 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 ...
- 关于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 ...
- Failed to start component [StandardEngine [Catalina].StandardHost[localhost].StandardContext[/项目名]]
问题: 最近几天在做一个小项目,今天中午本来想启动tomcat打开看看项目的,没想到项目突然无法打开,页面总是显示404 tomcat报错如下:Failed to start component [S ...
- tomcat启动时错误:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误
今天第一次遇到Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误,并且在错误提示的后半段出现了 ...
随机推荐
- 转:python webdriver API 之分页处理
对于 web 页面上的分页功能,我们一般做做以下操作: 获取总页数 翻页操作(上一页,下一页) 对于有些分页功能提供上一页,下一页按钮,以及可以输入具体页面数跳转功能不在本例的讨论范围. .. ...
- 【Origin】 画道
-夏之时,晚归途中,观云,感雨,识迷障,题以记之. 原道是东边日出西边雨, 却原来乌云蔽日雨不息; 只不过光芒也破云边洒, 可还是满地泥泞水花起. --作于二零一六年七月十一日
- yii2封装一个类控制div宽度,高度
1.首先,封装一个类,放在文件夹vendor下,命名为articls.php. <?phpclass Articles{ //测试 function add() { r ...
- struts2的处理流程_2015.01.05
01:首先经过web.xml里面的拦截 StrutsPrepareAndExecuteFilter 02:然后struts2内置的一些拦截器或用户自定义拦截器 Interceptor 03:用户编写的 ...
- swt byte[] 与 Image的转换
1. 从byte[]得到Image private static Image createImage(byte[] imageBytes) { Image image = null; try { By ...
- Session的工作机制详解和安全性问题(PHP实例讲解)
我们先简单的了解一些http的知识,从而理解该协议的无状态特性.然后,学习一些关于cookie的基本操作.最后,我会一步步阐述如何使用一些简单,高效的方法来提高你的php应用程序的安全性以及稳定行. ...
- cometd使用-bayeux协议(读法:贝叶)
bayeux.createChannelIfAbsent("/**", new ServerChannel.Initializer() { @Override public voi ...
- 四则运算GUI版本功能展现
对于四则运算的GUI版本实现支持批量出题,由于我的不积极导致教师没找到对应的连接,现在重新补上链接 http://www.cnblogs.com/liquan/p/5978687.html codin ...
- JSP注意点
一.JSP页面会编译成一个Servlet类,每个Servlet在容器中只有一个实例:在JSP中声明的变量是成员变量,成员变量只在创建实例时初始化,该变量的值将一直保存,直到实例销毁: 二.输出表达式& ...
- excel取消自动超链接的方法:还原和自动更正取消自动超链接
默认设置下,我们在excel表格中输入网址,一般excel都会自动将我们输入的网址自动更正为超链接.当单击该网址,就会打开相应的网页. 如果我们不想要自动添加超链接,请看下面的excel取消自动超链接 ...