Java Spring Tool Suite - Pivotal tc Server Developer Edition v3.0 所需的端口 8080 已在使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27174981/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 03:56:23  来源:igfitidea点击:

Spring Tool Suite - Port 8080 required by Pivotal tc Server Developer Edition v3.0 is already in use

javaspring-mvcspring-tool-suite

提问by Sami

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

在 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).

Pivotal tc Server Developer Edition v3.0 所需的端口 8080 已在使用中。服务器可能已经在另一个进程中运行,或者系统进程可能正在使用该端口。要启动此服务器,您需要停止其他进程或更改端口号。

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

………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………

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

下面是错误截图。 Error-Spring 工具套件

Also, below is what I get on localhost:8080

另外,下面是我在 localhost:8080 上得到的

localhost:8080

本地主机: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.

通过更改 server.xml (ie <Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${bio.https.port}" protocol="org.apache.coyote.http11.Http11Protocol" redirectPort="${bio.https.port}"/> ) 中的端口号,我得到了不同端口号的相同错误。

采纳答案by Aeseir

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

您有一个在 8080 上运行的应用程序,因此您需要终止当前在 8080 端口上运行的任何内容。

If you running Windows use:

如果您运行 Windows,请使用:

netstat -a -o | find "8080"

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

如果您运行 Mac OS(我认为您是),请使用:

sudo lsof -i :8080

Terminate that application and then launch Pivotal.

终止该应用程序,然后启动 Pivotal。

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

否则,您可以在配置文件中更改关键服务器端口:

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

Hope that helps.

希望有帮助。

回答by Richald

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:

选项卡 ---> VM 参数添加如下内容:

 -Dserver.port=8888

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

8888 可以是任何你想在其上运行 http 服务器的端口。

That's all, good luck.

就这些,祝你好运。

回答by Richald

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 TcpViewto 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
  • 更改服务器文件夹下 catalina.properties 文件中的端口号

    例如
    bio.http.port=
    18080 bio.https.port=18844

  • 终止在端口 8080(或任何其他引起问题的端口)上运行的 java.exe -
    使用TcpView 终止特定端口上的进程
  • 右键单击服务器,然后单击“清理 tc 服务器工作目录”
  • 右键单击服务器,然后单击“清理”
  • 然后你去“baaaam”

    清理服务器文件夹

回答by bkumar

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.

只需单击 Pivotal Tc Server Developer Edition v3.1 它将打开概述然后转到端口那里你会得到选项端口名称 - HTTP/1.1 ,portnumber-8080,有更改端口号 - 8888 不要在 Catalina.XML 中做任何更改.

回答by Mehedee Hassan

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

我想更新 Windows 的“user4023394's”答案:

  • double click on "Pivotal tc Server Developer Edition.."
  • 双击“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]
  • 将出现如下图所示的窗口,更改“neo.http.port”和“neo.https.port”的端口号[图中圈出]

enter image description here

在此处输入图片说明

  • right click on "Pivotal tc Server .." and click on "clean tc server work directory .."
  • 右键单击“Pivotal tc Server ..”,然后单击“clean tc server work directory ..”

enter image description here

在此处输入图片说明

  • restart the server.
  • 重新启动服务器。

回答by Anup Kumar

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

首先检查您的系统端口:8080。

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

我正在使用 linux ,我遵循了这种方法并且它对我有用。

Step 1 :sudo netstat -nlp | grep 8080

第 1 步:sudo netstat -nlp | 8080

It has shown which PID is listening to my port.

它显示了哪个 PID 正在侦听我的端口。

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

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

Step 2 :sudo kill -TERM 1112

第 2 步:sudo kill -TERM 1112

And run your project on STS :

并在 STS 上运行您的项目:

Run As -> Run on Server

运行方式 -> 在服务器上运行

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

它在http://localhost:8080/myapp/ 上运行良好

回答by Witold Kaczurba

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

如果您在 Windows 下使用 Eclipse 并且遇到此类问题 - 尝试杀死 javaw。[ Alt+ Ctrl+ Del] -> 进程;杀死爪哇。

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

这是一个没有太多思考的快速修复,因此请谨慎使用。

回答by Randika

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.

有时当您错误地关闭 sts 软件时会发生这种情况。例如:在运行项目时关闭软件或未保持完整工作状态正在保存。

  1. Clean tc server work directory
  2. Restart your machine
  3. Clean tc server work directory
  1. 清理 tc 服务器工作目录
  2. 重启你的机器
  3. 清理 tc 服务器工作目录

In my machine its worked

在我的机器上它起作用了

回答by riya

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

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

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

在 application.properties 文件中添加 server.port=8081

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.

下次尝试运行时,请停止服务器然后运行。