1. 程式人生 > >java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start com

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

maven 搭建ssh框架啟動報錯

嚴重: A child container failed during start

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

       atjava.util.concurrent.FutureTask.report(FutureTask.java:122)

       at java.util.concurrent.FutureTask.get(

FutureTask.java:192)

       atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)

       at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       atorg.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:266)

       atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

       atjava.util.concurrent.ThreadPoolExecutor$Worker.run(

ThreadPoolExecutor.java:617)

       at java.lang.Thread.run(Thread.java:745)

Causedby: org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]

       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

       ... 6 more

Causedby: java.lang.ClassCastException:org.springframework.web.SpringServletContainerInitializer cannot be cast tojavax.servlet.ServletContainerInitializer

       at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1670)

       atorg.apache.catalina.startup.ContextConfig.getServletContainerInitializers(ContextConfig.java:1652)

       atorg.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562)

       atorg.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)

       atorg.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)

       at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)

       atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

       atorg.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       ... 6 more

三月 09, 2018 12:56:16 下午 org.apache.catalina.core.ContainerBase startInternal

嚴重: A child container failed during start

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

       atjava.util.concurrent.FutureTask.report(FutureTask.java:122)

       at java.util.concurrent.FutureTask.get(FutureTask.java:192)

       atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)

       atorg.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)

       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       atorg.apache.catalina.core.StandardService.startInternal(StandardService.java:443)

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       atorg.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       atorg.apache.catalina.startup.Tomcat.start(Tomcat.java:341)

       atorg.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1238)

       atorg.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:592)

       atorg.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

       atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

       atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

       at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

       atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

       at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)

       atorg.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)

       atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)

       atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)

       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)

       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)

       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)

       at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)

       atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

       at java.lang.reflect.Method.invoke(Method.java:497)

       atorg.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

       atorg.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

       atorg.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

       atorg.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Causedby: org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Tomcat].StandardHost[localhost]]

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

       atorg.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:266)

       atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

       at java.lang.Thread.run(Thread.java:745)

Causedby: org.apache.catalina.LifecycleException: A child container failed duringstart

       atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)

       atorg.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)

       atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       ... 6 more

[INFO]------------------------------------------------------------------------

[INFO]BUILD FAILURE

[INFO]------------------------------------------------------------------------

[INFO]Total time: 4.184 s

[INFO]Finished at: 2018-03-09T12:56:16+08:00

[INFO]Final Memory: 16M/208M

[INFO]------------------------------------------------------------------------

[ERROR]Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run(default-cli) on project TrainTicket: Could not start Tomcat: Failed to startcomponent [StandardServer[-1]]: Failed to start component[StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]:A child container failed during start -> [Help 1]

[ERROR]

[ERROR]To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR]Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR]For more information about the errors and possible solutions, please read thefollowing articles:

原因:原pom.xml內配置

<!--匯入java ee jar -->

<dependency>

<groupId>javax</groupId>

<artifactId>javaee-api</artifactId>

<version>7.0</version>

</dependency>

</dependencies>

修改後:

<!-- 匯入java ee jar -->

<dependency>

<groupId>javax</groupId>

<artifactId>javaee-api</artifactId>

<version>7.0</version>

     <scope>provided</scope><!- 這裡 -->

</dependency>