Error Messages:
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] ....... Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] ...... Caused by: java.lang.ClassCastException: class org.springframework.web.SpringServletContainerInitializer cannot be cast to class javax.servlet.ServletContainerInitializer (org.springframework.web.SpringServletContainerInitializer is in unnamed module of loader org.apache.catalina.loader.WebappClassLoader @1e0295e0; javax.servlet.ServletContainerInitializer is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @3d88e6b9) ......
cause:
I imported the following dependencies in the project’s pom.xml and found that the tomcat7 plugin can’t run
E.g:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>javax.servlet.jsp-api</artifactId> <version>2.3.3</version> </dependency>
Check:
1. Check whether the current port is occupied by the process
2. Check whether there is a problem with the servlet mapping URL path in web.xml
3. Check for dependency conflicts
reason:
The servlet dependent version imported in the current Maven configuration file is too high and incompatible with tomcat7
Solution:
The tomcat7 plug-in in pom.xml can be upgraded to tomcat8
reference:
<pluginRepositories> <pluginRepository> <id>alfresco-public</id> <url>https://artifacts.alfresco.com/nexus/content/groups/public</url> </pluginRepository> <pluginRepository> <id>alfresco-public-snapshots</id> <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url> <snapshots> <enabled>true</enabled> <updatePolicy>daily</updatePolicy> </snapshots> </pluginRepository> <pluginRepository> <id>beardedgeeks-releases</id> <url>http://beardedgeeks.googlecode.com/svn/repository/releases</url> </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat8-maven-plugin</artifactId> <version>3.0-r1655215</version> <configuration> <port>80</port> <path>/</path> </configuration> </plugin> </plugins> </build>
last:
Refresh the Maven management tool, recompile the Maven project, and then start it with tomcat8!
Read More:
- kakfa Create topic Error: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 2.
- [Solved] Tomcat Startup Error: A child container failed during start、LifecycleException: Failed to start component
- Android solution Java.util.concurrent.ExecutionException: com.Android.ide.common.process.ProcessException: exception
- Android studio compilation failed: java.util.concurrent.ExecutionException: com.android.ide.common.process.Process
- [Solved] Tomcat7 Start Error: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardCon
- [Solved] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- [Solved] org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject…
- [Solved] SpringBoot Pack Project: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources
- [How to Solve Error]java.util.Date cannot be cast to java.sql.Date
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…
- [Solved] O2oa compile error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- [Solved] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- javaweb Connect Datas Error: che.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1444)
- [Solved] Scala error: type mismatch; found : java.util.List[?0] required: java.util.List[B]
- [Solved] JSON parse error: Cannot deserialize instance of `java.util.ArrayList<..> out of START_OBJECT token;
- SpringBoot Startup Error: Failed to start component [Connector[HTTP/1.1-8080]]
- [Solved] Tomcat Error: org.apache.tomcat.util.digester.Digester.fatalError Parse fatal error at line [40] column [36]