-1

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.

TaouBen
  • 979
  • 8
  • 23
  • 2
    The port may still be used by the OS after closing the application. Have you checked if the port is really not in use? – Pali Feb 17 '19 at 00:13
  • I fixed the error, Thank you Sir, I checked all ports I used and 8080 was in use. – TaouBen Feb 17 '19 at 14:04
  • @Pali Can you rewrite your response as an answer to my question so I can mark it as a correct answer. – TaouBen Feb 17 '19 at 14:06

3 Answers3

1

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.

Mauricio
  • 120
  • 1
  • 1
  • 8
  • I changed the port many times and it didnt worrk, It worked when I stopped the port occupied y tomcat 8080, Thank you Sir. – TaouBen Feb 17 '19 at 14:05
1

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.

Cyac
  • 267
  • 1
  • 8
1

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

Pali
  • 1,259
  • 1
  • 12
  • 36