Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]

前端 未结 5 874
孤独总比滥情好
孤独总比滥情好 2021-02-14 15:32

I am trying to build a SpringBoot application.

 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootAppli         


        
相关标签:
5条回答
  • 2021-02-14 15:44

    For me, upgrading javax.servlet-api to 4.0.1 did the trick:

    <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> </dependency>

    0 讨论(0)
  • 2021-02-14 15:46

    Looks like you have an incompatible version of Servlet API in ur classpath. This could have been as a dependencies to Jersey jars. Try pulling jersey starter from Spring boot starters.

    org.springframework.boot : spring-boot-starter-jersey
    

    This will bring the right version into your classpath.

    0 讨论(0)
  • 2021-02-14 15:46

    My guess is you have to use the default ServletInitializer class that is provided within the Spring Boot Project template of Eclipse.

    //SpringBootApplication.java
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    @SpringBootApplication
    public class SpringBootApplication {
    
        public static void main(String[] args) {
            SpringApplication.run(SpringBootApplication.class, args);
        }
    }
    
    //ServletInitializer.java
    public class ServletInitializer extends SpringBootServletInitializer {
    
        @Override
        protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
            return application.sources(SpringBootApplication.class);
        }
    
    }
    

    If you are not using ServletInitializer class as specified in Spring Boot Starter Project template, try to extend SpringBootServletInitializer from your App class

    public class App extends SpringBootServletInitializer
    

    Please check a similar answer here

    0 讨论(0)
  • 2021-02-14 15:54

    I solved this problem using tomcat configuration in pom.xml

    First go to tomcat folder and open cmd in bin my path is :

    C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>

    get tomcat version using this command

    C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>catalina.sh version

    After this add this in pom.xml

    <properties>
            <java.version>1.8</java.version>
            <tomcat.version>8.5.43</tomcat.version>
    </properties>
    
    0 讨论(0)
  • 2021-02-14 16:01

    I had the same issue, After commenting out the below it was fixed. One of the follwoing dependency was the culprit.

        <!--  dependency>
        <groupId>me.fhir</groupId>
        <artifactId>fhir</artifactId>
        <version>0.12.0-RELEASE</version>
    </dependency-->
    <!--  dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.8.8</version>
    </dependency-->
    <!-- dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.8.8</version>
    </dependency-->
    
    0 讨论(0)
提交回复
热议问题