Spring boot: Unable to start embedded Tomcat servlet container

后端 未结 8 1421
孤街浪徒
孤街浪徒 2020-12-09 15:26

I\'m new to Spring Boot and having with error while running my application. I\'m following a tutorial and I believe I\'m having proper parent and dependencies with POM, plea

8条回答
  •  盖世英雄少女心
    2020-12-09 16:07

    Simple way to handle this is to include this in your application.properties or .yml file: server.port=0 for application.properties and server.port: 0 for application.yml files. Of course need to be aware these may change depending on the springboot version you are using. These will allow your machine to dynamically allocate any free port available for use. To statically assign a port change the above to server.port = someportnumber. If running unix based OS you may want to check for zombie activities on the port in question and if possible kill it using fuser -k {theport}/tcp. Your .yml or .properties should look like this. server: port: 8089 servlet: context-path: /somecontextpath

提交回复
热议问题