Spring Download the application in eclipse, the Tomcat connector configured to listen on port XXXX could not start

I am developing a REST API using the Spring Framework

At first, I could not start my application due to the same problem. Port 8080 on my computer is busy. Then I discovered that one of the alternatives to solve this problem is to create an application.properties file in the src/main/resources folder. This is what I did and configured the server to listen on port 8090. This worked, but only for the first time, now I get the same exception when I try to run the application a second time.

 Description: The Tomcat connector configured to listen on port 8090 failed to start. The port may already be in use or the connector may be misconfigured. Action: Verify the connector configuration, identify and stop any process that listening on port 8090, or configure this application to listen on another port. 

As far as I know, this environment uses a built-in instance of Apache Tomcat to deploy each application.

I assume that the server does not restart the second time when I try to start the application, so the output says: "The port may be already in use or the connector is configured incorrectly"

So, more specific questions may be, how can I manage the embedded apache tomcat instance manually or programmatically?

I also changed the port twice in the application.properties file. It works fine, but again, only for the first time. As you can imagine, I cannot do the same every time the application is launched.

+35
source share
14 answers

On the console, looking at the upper right side of the dialog box, you will see a red button that looks like a buzzer. To stop the spring boot application correctly, you just launched it, click and click this red button, and your problem will be solved. Hope this helps!

+36
source
  1. Find the process identifier (PID) for the port (for example: 8080 )

    On Windows:

     netstat -ao | find "8080" 

    Other platforms besides Windows:

     lsof -i:8080 
  2. Kill the process id that you found (for example: 20712)

    On Windows:

     Taskkill /PID 20712 /F 

    Other platforms besides Windows:

     kill -9 20712 or kill 20712 
+54
source

Another easy way to resolve this error is to right-click in the console and click "Finish / Disable All." After that, run the application, it should work fine.

+23
source

This is because you do not stop your application before starting it another time, so it says that the port is already in use.

You should always stop the application before restarting it, otherwise you will run into problems with port conflict.

Depending on your platform, if you run it on windows, you can use netstat -anp | find "port number" netstat -anp | find "port number" , or if you use it on linux, you can use netstat -ntpl | grep "port number" netstat -ntpl | grep "port number" or, if using mac, use lsof -n -iTCP:"port number" .

+10
source

I already run into this problem when I run for the first time and then want to run another project that I received again:

 The Tomcat connector configured to listen on port 8088 failed to start. The port may already be in use or the connector may be misconfigured. Action: Verify the connector configuration, identify and stop any process that listening on port 8088, or configure this application to listen on another port. 

And finally, I got a solution for this, which is given in the screenshot below:

enter image description here

Right-click on the “ Console ” tab → and select “ End / Disable All”. Now try running your code.

Note Remember to stop the server before starting.

+10
source

Find the process and complete it. On Windows, do Control + Alt + Delete, and then find the “Java (TM) Platform SE Binary” process on the Processes tab. For instance: enter image description here

On Ubuntu, you can use “ps aux | grep java” to find the process, and “kill -9 PID_NUMBER” to kill the process.

OR

If you are using a Spring boot application, go to application.properties and add the following:

 server.port = 8081 
+9
source

If your application is running in httpS, make sure you specify the correct values ​​in the following properties:

 server.ssl.key-store-password= server.ssl.key-alias= 

I got the same error when I put the wrong values ​​here

+3
source
  • check busy port: netstat -ntlp
  • kill this port: kill -9 xxxx
+2
source

On Windows:

To get started, open a command prompt by clicking Start, and then type cmd. At the command prompt, go ahead and enter the following command:

netstat -a -n -o

In the command above, the -o option is what adds the PID to the end of the table. Press enter and you should see something like this:

enter image description here

Now, to see the name of the process using this port, go to the task manager by pressing CTRL + SHIFT + ESC, and then go to the Process tab. In Windows 10, you must click on the Details tab.

By default, the task manager does not display the process ID, so you need to click "View" and then "Select Columns".

You may also need to learn about services running in the background. To do this, right-click and select open services, as shown below:

enter image description here

Hope it helps :)

+2
source

This problem can be solved in two ways:

  1. Kill an application running on 8080
 netstat -ao | find "8080" Taskkill /PID 1342 /F 
  1. change Spring server port in application.properties file

server.port = 8081

+2
source

There are two options to handle / avoid this situation.

  1. Before restarting the application, simply disconnect the previous connection.

    • Open the console --> right click --> terminate all.
  2. If you forgot to mention the action in step 1, then

    • Determine the port used by your application, you can see its stack trace in the console window
    • Determine the process ID associated with the port by running netstat -aon in cmd
    • Kill this process and restart the application.
+1
source

if it’s convenient for you and you don’t want to use the command line, you can restart the computer, it will help!

0
source

The easiest way to solve this problem is to change the port in the application.properties file;

enter image description here

server.port = 8081

0
source

right click on console and stop

right click on the console and complete. or click on stop

enter image description here

-1
source

Source: https://habr.com/ru/post/1265917/


All Articles