简体   繁体   English

java.net.BindException:地址已在使用中:8080

[英]java.net.BindException: Address already in use:8080

I am trying to run a Java webapp build instance but it stops in the middle of the build with this error: 我正在尝试运行Java Webapp构建实例,但它在构建中间停止,并出现以下错误:

java.net.BindException: Address already in use:8080 java.net.BindException:地址已在使用中:8080

It's obviously trying to bind to the 8080 port but another process has already done so and wont share. 显然,它试图绑定到8080端口,但另一个进程已经这样做,并且不会共享。

So, I checked to see what process is using the 8080 (netstat -anp | grep 8080). 因此,我检查了使用8080的进程(netstat -anp | grep 8080)。 Apparently the jsvc.exec process is listening to my 8080 port. 显然jsvc.exec进程正在侦听我的8080端口。 Upon checking (ps -fp) I find out that this is Tomcat (boostrap.jar). 检查(ps -fp)后,我发现这是Tomcat(boostrap.jar)。

So, to see if the build would at least complete, I killed the process. 因此,为了查看构建是否至少完成,我终止了该过程。 And yeah!! 是的! The Webapp build installed completely. Webapp构建已完全安装。 But when I navigated my browser to localhost:8080 it says the service is not running - coz I killed Tomcat! 但是,当我将浏览器导航到localhost:8080时,它说该服务未运行-因为我杀死了Tomcat! I even tried localhost:8080/manager/list. 我什至尝试了localhost:8080 / manager / list。 Still said service not running. 仍然说服务没有运行。

So I restart Tomcat, checked localhost:8080 and Tomcat was back up. 因此,我重新启动了Tomcat,检查了localhost:8080并备份了Tomcat。 Checked localhost:8080/manager/list but did not see the Webapp instance I had just built. 检查了localhost:8080 / manager / list,但没有看到我刚刚构建的Webapp实例。

What I am not getting here! 我没有到这里! My webapp wont build if I run tomcat (cant share 8080). 如果我运行tomcat(共享8080),我的webapp将无法构建。 And If i kill tomcat to complete the build, the webapp obviously cant run coz Tomcat is dead. 而且,如果我杀死了tomcat以完成构建,则Webapp显然无法运行,因为Tomcat已死。

Please help me. 请帮我。 Running Tomcat 5.5 in a LAMP environment on a remote server. 在远程服务器上的LAMP环境中运行Tomcat 5.5。 NOTE: I am running a pre-built webapp build application (war) which I cant make changes to. 注意:我正在运行无法更改的预构建webapp构建应用程序(war)。

During a build? 在构建期间? A build process usually doesn't require a port to be open. 构建过程通常不需要打开端口。 The issue is that two programs are attempting to use the same port. 问题是两个程序试图使用相同的端口。 Without fixing the underlying issue, the immediate fix is to change the port Tomcat is running on. 如果不解决根本问题,立即的解决方法是更改​​Tomcat运行的端口。 To change the port Tomcat runs on, edit install_dir/conf/server.xml and change the port attribute of the Connector element from 8080 to 8081. 要更改Tomcat运行的端口,请编辑install_dir / conf / server.xml并将Connector元素的端口属性从8080更改为8081。

If this is your first time running Confluence or you have recently added applications or made changes to the system, investigate what's running on port 8080. 如果这是您第一次运行Confluence,或者您最近添加了应用程序或对系统进行了更改,请调查端口8080上正在运行的内容。

If Confluence was not shut down properly, you can restart the machine or kill the process: On Windows: 如果未正确关闭Confluence,则可以重新启动计算机或取消进程:在Windows上:

  1. Hit Ctrl-alt-delete and look at open programs. 点击Ctrl-alt-delete并查看打开的程序。 Look for {{java.exe}}. 寻找{{java.exe}}。

  2. From a command window, run {{netstat -an}} . 在命令窗口中,运行{{netstat -an}} Check which ports are in use. 检查正在使用的端口。 You can identify which application is running this way, then close it from the Task Manager. 您可以确定哪个应用程序正在以此方式运行,然后从任务管理器中将其关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM