在Eclipse中的Spring Boot应用程序,配置为侦听端口XXXX的Tomcat连接器无法启动

San*_*992 37 java eclipse spring tomcat spring-boot

我正在使用SpringFramework开发API REST

首先,由于同样的问题,我无法运行我的应用程序.我电脑上的端口8080正忙.然后我发现解决这个问题的另一种方法是application.propertiessrc/main/resources文件夹下创建一个文件.这就是我所做的,并设置服务器以侦听端口8090.这只是第一次工作,现在每当我尝试第二次运行应用程序时,我得到相同的异常.

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's configuration, identify and stop any process that's listening on port 8090, or configure this application to listen on another port.
Run Code Online (Sandbox Code Playgroud)

据我所知,这个框架利用apache tomcat的嵌入式实例来部署每个应用程序.

我的猜测是,第二次尝试运行应用程序时,服务器没有重新启动,这就是为什么输出显示"端口可能已在使用或连接器可能配置错误"

那么,更具体的问题是,如何手动或以编程方式管理apache tomcat的嵌入式实例?

我还修改了application.properties文件中的端口两次.它工作正常,但同样,这是第一次.你可以想象,每次应用程序执行时我都不能这样做.

在此先感谢您的帮助.

到目前为止,这个问题已经引起了争议,一个负面的评论是针对一个没有用或者没有展示任何研究成果的问题.请记住,在学习如何使用新框架时,可能存在一些您不知道如何解决的问题,因为您实际上不知道框架在后台执行的操作.所以,不要给这个问题带来负面评价,请参考我可以开始寻找更多相关信息的链接.

sy4*_*456 60

  1. 找到端口的进程ID(PID)(例如:8080)

    在Windows上:

    netstat -ao | find "8080"
    
    Run Code Online (Sandbox Code Playgroud)

    Windows以外的其他平台:

    lsof -i:8080
    
    Run Code Online (Sandbox Code Playgroud)
  2. 杀死你找到的进程ID(例如:20712)

    在Windows上:

    Taskkill /PID  20712 /F
    
    Run Code Online (Sandbox Code Playgroud)

    Windows以外的其他平台:

    kill -9 20712   or kill 20712
    
    Run Code Online (Sandbox Code Playgroud)


小智 39

在控制台上,查看对话框的最右上角,您会看到一个红色按钮,就像一个蜂鸣器.要正确停止弹簧启动应用程序,您只需运行,继续按下此特定的"红色"按钮,您的问题就解决了.希望这可以帮助!


Dvi*_*act 23

解决此错误的另一种简单方法是右键单击控制台并单击Terminate/Disconnect All.之后运行应用程序它应该工作正常.


Ami*_*wal 10

这是因为你没有停止你的应用程序,然后再启动它,因此它说端口已经在使用中.

您应该在再次启动之前停止应用程序,否则您将遇到端口冲突问题.

根据您的平台,如果您在Windows上运行它可以使用,netstat -anp | find "port number"或者如果您在Linux上运行它,您可以使用netstat -ntpl | grep "port number"或者如果使用mac lsof -n -iTCP:"port number".


Gen*_*ene 10

找到进程并终止它.在Windows上执行Control + Alt + Delete,然后在Processes选项卡下找到"Java(TM)Platform SE Binary"进程.例如: 在此输入图像描述

在Ubuntu上,您可以使用"ps aux | grep java"来查找进程并"kill -9 PID_NUMBER"来终止进程.

要么

如果您使用的是Spring启动应用程序,请转到application.properties并添加以下内容:

server.port = 8081
Run Code Online (Sandbox Code Playgroud)


小智 10

当我第一次运行时,我已经面临这个问题,然后又想再运行我得到的另一个项目:

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's configuration, identify and stop any process that's listening on port 8088, or configure this application to listen on another port.
Run Code Online (Sandbox Code Playgroud)

最后我得到了解决方案,如下面的屏幕截图所示:

在此输入图像描述

右键单击Console选项卡 - >并选择Terminate/Disconnect all 现在尝试运行您的代码.

注意:在再次运行之前,不要忘记停止服务器.


Fil*_*lip 5

如果您的应用程序在 httpS 上运行,请确保在以下属性下放置正确的值:

server.ssl.key-store-password=
server.ssl.key-alias=
Run Code Online (Sandbox Code Playgroud)

当我在这里输入错误的值时,我遇到了同样的错误