ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component解決


第一:先確定一下開發流程是否正確

1.寫好servlet組件類

2.寫好web.xml文件--向服務器介紹組件

3.發布--就是拷貝

  注意:要拷貝包結構,不要只拷貝組件類文件

          另外,拷貝的是.class文件,不是.java文件。

4.啟動Tomcat服務器

如果流程正確還是如標題的問題,那就是web.xml肯定有問題

結構如下:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app 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_3_0.xsd"
  version="3.0"
  metadata-complete="true">

  <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>com.felix.servlet.HelloServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/hello</url-pattern>
  </servlet-mapping>


</web-app>
其中出下面的部分外,其他部分可以從Tomcat服務器提供的web應用的例程中的web.xml直接拷貝。 
<servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>com.felix.servlet.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping>

可能的錯誤原因:

1.servlet  servlet-name   servlet-class  servlet-mapping  url-pattern 有拼寫錯誤
2.servlet-class路徑有問題
3.url-pattern過濾器中缺少/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] 嚴重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springmvc-day01]] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] IDEA啟動tomcat報錯:java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext、ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component tomcat啟動報錯:java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: tomcat啟動報錯:java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Tomcat無法啟動:org.apache.catalina.LifecycleException: Failed to start component 問題解決 IDEA啟動項目報錯:org.apache.catalina.LifecycleException: Failed to start component的解決辦法 tomcat啟動報錯:org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM