问题
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.
Also, below is what I get on 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.
回答1:
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.
回答2:
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"
回答3:
I want to update "user4023394's" answer for windows :
- double click on "Pivotal tc Server Developer Edition.."
- a window will appear like the below image, change port number for "neo.http.port" and "neo.https.port" [circled in the image]
- right click on "Pivotal tc Server .." and click on "clean tc server work directory .."
- restart the server.
回答4:
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.
回答5:
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/
回答6:
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.
- Clean tc server work directory
- Restart your machine
- Clean tc server work directory
In my machine its worked
回答7:
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.
回答8:
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.
回答9:
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.
来源:https://stackoverflow.com/questions/27174981/spring-tool-suite-port-8080-required-by-pivotal-tc-server-developer-edition-v3