简体   繁体   中英

My Tomcat connector configured to listen on a port failed to start?

I am new to Spring boot, I am trying to build a simple CRUD application, but I get this error when I run my app and I dont know how to solve it.

here is my application.properties file :

server.port = 8079
spring.datasource.url=jdbc:mysql://localhost:8889/employee?useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.database-platform = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = update

But I get the error :

The Tomcat connector configured to listen on port 8079 failed to start. The port may already be in use or the connector may be misconfigured.

I changed the port many times but I still get the error so my connector must be misconfigured.

Any help would be much much appreciated.

As the error states, the port may be in used by your OS by another program, try changing the port number. If you were successful on running your application the first time then it means you are not closing the app correctly and the thread is still running on your system.

As @Mauricio and @Pali has pointed out this happens when the port is in use. Is it possible when you change ports it's running first time but not when you run a second time - the reason being you did not shut down the first process? Check the processes listening on the port that is in use. This shows how to check processes in Windows. Check this for doing similar check in Linux.

The port may still be used by the OS after closing the application. Have you checked if the port is really not in use?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM