9
votes

I get the following error when running codes in Spring Tool Suite.

..............................................................................

Port 8080 required by Pivotal tc Server Developer Edition v3.0 is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

..............................................................................

Below is a screenshot of the error. Error-Spring Tool Suite

Also, below is what I get on localhost:8080

localhost:8080

By changing port numbers in server.xml (i.e. <Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${bio.https.port}" protocol="org.apache.coyote.http11.Http11Protocol" redirectPort="${bio.https.port}"/> ), I get the same error with different port numbers.

9
So have you checked what you have running on port 8080? Why not use another port other than 8080?Aeseir
@Aeseir, thanks for your comment. Please review the question again with more info.Sami

9 Answers

13
votes

You have a application running on 8080, so you need to terminate whatever is running currently on 8080 port.

If you running Windows use:

netstat -a -o | find "8080"

If you running Mac OS (which i think you are) use:

sudo lsof -i :8080

Terminate that application and then launch Pivotal.

Otherwise you can change pivotal server port in the config file:

<your tc server folder location>/conf/catalina.properties

Hope that helps.

5
votes

steps to be followed

  • change the port number in catalina.properties file under server folder

    e.g.
    bio.http.port=18080
    bio.https.port=18844

  • kill the java.exe running on port 8080(or any other port which poses the issue)-
    Use TcpView to kill the process on specfic port
  • Right click on the server and then click on "clean tc server work directory"
  • Right click on the server and then click on "Clean"
  • and there u go "baaaam"

    Cleaning server folder
5
votes

I want to update "user4023394's" answer for windows :

  • double click on "Pivotal tc Server Developer Edition.."

enter image description here

  • a window will appear like the below image, change port number for "neo.http.port" and "neo.https.port" [circled in the image]

enter image description here

  • right click on "Pivotal tc Server .." and click on "clean tc server work directory .."

enter image description here

  • restart the server.
4
votes

You can enter:

run configurations

Find you app name in tree struct below:

java application

and in:

(X) = Arguments

tab ---> VM arguments add something like this:

 -Dserver.port=8888

8888 can be any port you want run http server on it.

That's all, good luck.

3
votes

First of all check your port : 8080 on your system.

I am using linux , i have followed this approach and it worked for me.

Step 1 : sudo netstat -nlp | grep 8080

It has shown which PID is listening to my port.

tcp6 0 0 :::8080 ::: LISTEN 1112/java*

Step 2 : sudo kill -TERM 1112

And run your project on STS :

Run As -> Run on Server

And it worked fine on http://localhost:8080/myapp/

1
votes

Sometimes it happened when you shutdown wrongfully sts software. Ex : close software while running your project or didn't stay full working status are saving.

  1. Clean tc server work directory
  2. Restart your machine
  3. Clean tc server work directory

In my machine its worked

0
votes

If you are using Eclipse under windows and you get this sort of problems - try killing javaw. [Alt + Ctrl + Del] -> Processes; kill javaw.

This is a quick fix without much thinking so use with caution.

0
votes

Reference:- https://www.baeldung.com/spring-boot-change-port

Add the server.port=8081 in application.properties file

This worked for me. For more details, you can click on the above link.

Next time when you try to run, stop the server and then run.

-1
votes

just click on Pivotal Tc Server Developer Edition v3.1 it will open overview then go to ports there you get option port name- HTTP/1.1 ,portnumber-8080, there change port number- 8888 don't make any changes in Catalina.XML.