Spring Boot Application immediately shuts down after starting

后端 未结 4 1465

I am working currently on a project which includes the Spring Framework. Everything is working as aspect but there is one problem. When I try to start my application onto my lap

相关标签:
4条回答
  • 2021-02-08 19:18

    Add this dependency:

    <dependency>          
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    
    0 讨论(0)
  • 2021-02-08 19:18

    I met the same problem, I fix by these steps as below:
    update file application.yml

    1- remove:

    main:
        web-application-type: none
    

    2- if your change server port already, it's still error:

    Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

    solution: move server port config on the top of yml file

    Done! it's for my case.

    0 讨论(0)
  • 2021-02-08 19:20

    For me what caused this was that I had this property below, in the application properties (carried over by mistake from a test application.properties file). See if any of your property files that are included have this like below, and remove it:

    # disables the servlet-container initialization (for unit testing only)
    spring.main.web-application-type=none
    
    0 讨论(0)
  • 2021-02-08 19:34

    Problem is solved - thanks for your help crazycoder. The issue was caused by an older version of tomcat. After upating the embedded tomcat of Spring to 1.5.3_RELEASE and updating mysql-jdbc-driver as well , it finally worked for me. I adjusted the pom.xml like this:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>
    
    0 讨论(0)
提交回复
热议问题