端口 8080 已在使用中时出现错误

发布于 2024-10-01 10:15:26 字数 503 浏览 1 评论 0原文

谁能帮我解决以下案例?

我正在尝试使用 java 并使用在 Ubuntu 9.10 上运行的 Eclipse Galileo 生成我的第一个网站。自从我生成第一行代码以来,我还没有见过网络。当我尝试运行该程序时,总是出现以下错误:

本地主机上的 Tomcat v6.0 服务器所需的几个端口 (8080、8080) 已在使用中。服务器可能已经在另一个进程中运行,或者系统进程可能正在使用该端口。要启动此服务器,您需要停止其他进程或更改端口号。

我已经阅读了很多有关更改 Tomcat 端口的方法(从 8080 传递到80) 但这是不可能的。我读过一些论坛,其中解决此问题的方法是访问包含 tomcat 服务器编号的文件,该文件是一个 XML 文件,但是当我打开该文件夹时,没有包含该名称的 xml 文件。

我已经使用 sudo lsof -n -P -i :、启动和关闭 tomcat 探索了端口,但错误仍然存​​在。

我能做些什么?

多谢。

Can anyone help me to solve the following case?

I am trying to generate my first web site using java and working with Eclipse Galileo running on Ubuntu 9.10. Since I generate my first lines of code I haven't seen the web. All the time when I try to run the program I get the following error:

Several ports (8080, 8080) required by Tomcat v6.0 Server at localhost are 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).

I have read a lot about the way to change the ports for my tomcat (pass from the 8080 to 80) but it has been impossible. I read some forums where the way to solve this problem is going to the file that contents the server number for tomcat, which is a XML file, but when I open the folder there is not a xml file with the name.

I already explored the port using sudo lsof -n -P -i :, start and shut-down tomcat but the mistake is still there.

What can I do?

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

世界和平 2024-10-08 10:15:26

单击 Eclipse 中的“服务器”选项卡,然后双击其中列出的服务器。
在打开的配置页面中选择端口选项卡。将端口更改为任何其他端口。重新启动服务器。

Click on servers tab in eclipse and then double click on the server listed there.
Select the port tab in the config page opened.Change the port to any other ports.Restart the server.

快乐很简单 2024-10-08 10:15:26

在Mac上,我通常如何解决它

  1. 打开终端并cd到downloaded-apache-files-folder/bin(即shutdown.sh文件所在的文件夹)
  2. 输入“sh shutdown.sh”作为终端命令
  3. 重新启动Tomcat/Eclipse ..多达!

希望这对OP或其他人阅读有帮助

on Mac, how I usually solve it

  1. open terminal and cd to downloaded-apache-files-folder/bin (i.e to the folder where shutdown.sh file is located)
  2. enter "sh shutdown.sh" as a terminal command
  3. restart Tomcat/Eclipse..tada!

Hope this helps OP or someone else reading

吃素的狼 2024-10-08 10:15:26

在 apache conf 文件夹中,打开 httpd 文件并查找 8080 端口。将 8080 更改为您喜欢的任何端口。我相信你会在两个地方找到8080。重新启动服务器以查看更改。

In your apache conf folder, open the httpd file and look for 8080 port. Change 8080 to any port you like. I believe you will find 8080 on two places. Restart your server to see changes.

濫情▎り 2024-10-08 10:15:26

如果您使用 wtp 从 eclipse 内部运行,您应该能够从“服务器”视图更改端口(窗口 -> 显示视图 -> 服务器)

if you are running from inside eclipse with wtp, you should be able to change the port from the "servers" view (window -> show view -> servers)

摇划花蜜的午后 2024-10-08 10:15:26

您已经运行了另一个 Tomcat 实例。您可以通过在网络浏览器中访问 http://localhost:8080 并检查是否获得 Tomcat 默认主页来确认这一点页面或 Tomcat 特定的 404 错误页面。两者都是 Tomcat 运行良好的同等有效证据;如果没有,那么您将收到浏览器特定的 HTTP 连接超时错误消息。

你需要将其关闭。进入 Tomcat 安装文件夹的 /bin 子文件夹,执行 shutdown.bat (Windows) 或 shutdown.sh (Unix) 脚本。

查看此答案了解更多信息。

You've another instance of Tomcat already running. You can confirm this by going to http://localhost:8080 in your webbrowser and check if you get the Tomcat default home page or a Tomcat-specific 404 error page. Both are equally valid evidence that Tomcat runs fine; if it didn't, then you would have gotten a browser specific HTTP connection timeout error message.

You need to shutdown it. Go to /bin subfolder of the Tomcat installation folder and execute the shutdown.bat (Windows) or shutdown.sh (Unix) script.

check this answer for more information.

再可℃爱ぅ一点好了 2024-10-08 10:15:26

已经很久了,但我遇到了同样的问题,并解决如下:
1.尝试使用 shutdown.bat/.bash 关闭应用程序服务器,该文件可能位于您的应用程序服务器 / bin/shutdown 中。

  1. 我的问题是,超过 1 个 java 实例正在运行,我正在更改端口,而不是回头看,所以它继续使用该特定端口运行其他 java 进程。
    对于 Windows 用户,: ALT+Shift+Esc,并结束您不使用的 java 进程,现在您应该能够重新使用端口 8080

It has been long time, but I faced the same Issue, and solved it as follow:
1. tried shutting down the application server using the shutdown.bat/.bash which might be in your application Server / bin/shutdown..

  1. My Issue, was that more than 1 instance of java was running, I was changing ports, and not looking back, so it kept running other java processes, with that specific port.
    for windows users, : ALT+Shift+Esc, and end java processes that you are not using and now you should be able to re-use your port 8080
长伴 2024-10-08 10:15:26

此问题的解决方案是:

第 1 步:停止 Tomcat(无论情况如何,通过服务或 .bat/.sh )。

第2步:删除eclipse上已经配置的Apache Tomcat。

第 3 步: 现在在 eclipse 上重新配置 apache,并使用 eclipse 提供的 UI 启动服务器。

我有同样的问题并且它已经起作用了。

The solution to this issue is:

Step 1: Stop Tomcat(By service or by .bat/.sh what ever the case may be ).

Step 2: Delete the already configured Apache Tomcat on eclipse.

Step 3: Now reconfigure the apache on the eclipse and start the server using UI as provided by eclipse.

I have the same issue and it has worked.

向地狱狂奔 2024-10-08 10:15:26

这对我有用>
在 Eclipse NEON 中,双击“服务器”选项卡,该选项卡将重定向服务器概述窗口。

您可以在此处根据 Tomcat 管理和 HTTP 端口的要求更改端口号。

并重新启动服务器。

希望这对您有帮助。

This Worked for me >
In Eclipse NEON double clicked on Server tab which redirects server overview window

Here you can change port number based on your requirement for Tomcat Admin and HTTP port.

And restarted the server.

Hope this helps you.

寂寞清仓 2024-10-08 10:15:26

我遇到了类似的问题,这是解决方案。

第 1 步:双击 Eclipse 中列出的服务器。此处将显示服务器配置。

第 2 步: 只需更改端口号,例如从 8080 更改为 8085。

第 3 步: 保存更改。

第 4 步:重新启动您的服务器。

服务器将启动。希望对您有帮助。

I faced a similar problem , here's the solution.

Step 1 : Double click on the server listed in Eclipse. Here It will display Server Configuration.

Step 2 : Just change the port Number like from 8080 to 8085.

Step 3 : Save the changes.

Step 4 : re-start your server.

The server will start .Hope it'll help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文