1

Tomcat can't start out of blue.. or I don't remember where I changed. The error messages are as below.

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 6 more
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
    at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:90)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1543)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1265)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

Why org.apache.catalina.LifecycleException: Failed to start component ?

Roman C
  • 49,761
  • 33
  • 66
  • 176
user3560221
  • 51
  • 2
  • 7
  • Check that you have not duplicate servlet-api jars when deployed to the tomcat server. – Roman C Apr 22 '14 at 12:24
  • it was solved earlier. but i am not so sure where the problems were. i think you are probably right. the problems were about the jar files. like: put these only in tomcat/lib servlet-api.jar geronimo-servlet_2.5_spec.jar put struts2 jars only in WEB-INF/lib add commons-logging.jar and servlet-api.jar in server's classpath... – user3560221 Apr 22 '14 at 13:12
  • Can you run the server after a fresh installation? – Roman C Apr 22 '14 at 13:44
  • yes, it can start properly. just another problem during runtime, about notfoundcexception. i posted it here: http://stackoverflow.com/questions/23220862/classnotfoundexception-strutsprepareandexecutefilter-in-struts2 – user3560221 Apr 22 '14 at 13:51
  • You have wrong versions of libraries, messed up with the server jars. Try maven, download only required jars from the central repository, and you are almost done. – Roman C Apr 22 '14 at 14:17
  • @RomanC, how can i know the versions are wrong? my network doesnt allow me to download with maven and i tried before. and im not using maven. u mean the servlet-api.jar ? – user3560221 Apr 22 '14 at 14:21
  • @user3560221 i'm also working on a struts2 project. even i didn't used maven. what i did was to download latest jars from maven repo. here's the link for [struts2 core](http://mvnrepository.com/artifact/org.apache.struts/struts2-core) you can search for other jars here only. you can also download complete struts package from apache website. its hardly 13-14mb – maxx777 Apr 22 '14 at 15:03

1 Answers1

0

You have wrong versions of libraries, messed up with the server jars. Try maven, download only required jars from the central repository, and you are almost done. See the example of developing a maven project Create Struts 2 Web Application Using Maven To Manage Artifacts and To Build The Application.

You can start comparing them from the lib folder and the struts lib package. servlet-api only needs to compile your app but should not deploy it.

Roman C
  • 49,761
  • 33
  • 66
  • 176