eclipse 通过eclipse启动jsp程序时Tomcat 8端口问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29714239/
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-09-19 22:33:42  来源:igfitidea点击:

Tomcat 8 port issue while lauching jsp programs via eclipse

javaeclipsejsptomcattomcat8

提问by Ajay Kulkarni

I just wrote a project for online banking by using jsp. I integrated tomcat 8 with eclipse and when I launch the project by using tomcat 8 in eclipse, I get the following error:

我刚刚使用jsp. 我将 tomcat 8 与 eclipse 集成,当我在 eclipse 中使用 tomcat 8 启动项目时,出现以下错误:

Several ports (8005, 8080, 8009) required by Tomcat v8.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).  

But I've made sure that apache uses port 80. How can I resolve this error?

但我已经确定 apache 使用port 80. 我该如何解决这个错误?

When I launch tomcat in firefox, I get the error like this:
error
How can I fix this one?

当我在 Firefox 中启动 tomcat 时,出现如下错误:
错误
我该如何解决这个问题?

回答by iamsuman

1) Go to conffolder in tomcat installation directory

1)进入conftomcat安装目录下的文件夹

e.g. C:\Tomcat 6.0\conf\

2) Edit following tag in server.xmlfile

2)在server.xml文件中编辑以下标签

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

3) Change the port=8080 value to port=8081

3) 将端口=8080 值更改为 port=8081

4) Save the file

4) 保存文件

5) Restart the server

5)重启服务器

回答by Jirson Tavera

You have other instance of Tomcat Running, to resolve it you should to shutdown it.

您有 Tomcat 正在运行的其他实例,要解决它,您应该关闭它。

got to /bin subfolder on the tomcat installation folder and executeshutdown.xx file:

到 tomcat 安装文件夹中的 /bin 子文件夹并执行shutdown.xx 文件:

Depending shutdown.bash for windows or shutdown.sh for unix.

取决于windows 的shutdown.bash 或unix 的shutdown.sh。

回答by Manohar Manu

When you try to run a jsp program on Tomcat server in eclipse, you are getting the below error in the eclipse console "Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use."

当您尝试在 eclipse 中的 Tomcat 服务器上运行 jsp 程序时,您在 eclipse 控制台中收到以下错误“本地主机上的 Tomcat v6.0 服务器所需的多个端口(8005、8080、8009)已在使用中。”

Solution

解决方案

The issue is because you've another instance of Tomcat already running. To solve this 1. Go to bin folder of Tomcat (eg C:\apache-tomcat-7.0.23\bin ) 2. Run startup.bat 3. Run shutdown.bat 4. Start the tomcat from eclipse

问题是因为您已经在运行另一个 Tomcat 实例。要解决这个问题 1. 转到 Tomcat 的 bin 文件夹(例如 C:\apache-tomcat-7.0.23\bin ) 2. 运行 startup.bat 3. 运行 shutdown.bat 4. 从 eclipse 启动 tomcat

回答by marcello.hk

on eclipse ide

在日食ide

1 - Windows-> Show view-> Other...
2 - search "Servers"-> Open
3 - search in tabs "Servers"and double click im "Tomcat v8.0 Server at localhost"
4 - in Ports "Port Name"u change the ports
....4.1* Tomcat admin port -> change "8005" to "8006"
....4.2* HTTP/1.1 > change "8080" to "8081"
....4.3* AJP /1.3 > change "8009" to "8010"

1 - Windows-> Show view-> Other...
2 - 搜索"Servers"-> Open
3 - 在选项卡中搜索"Servers"并双击 im "Tomcat v8.0 Server at localhost"
4 - 在Ports "Port Name"你更改端口
....4.1* Tomcat 管理端口 -> 更改"8005" to "8006"
....4.2* HTTP/1.1 > 更改"8080" to "8081"
....4.3* AJP /1.3 > 改变"8009" to "8010"

sorry for wrong words.

对不起,说错话了。

回答by Harshad Holkar

Change the port numbers. Earlier mine was

更改端口号。早些时候我的是

Tomcat Admin Port : 8005(I changed it to 8006) HTTP : 8080 (I changed it to 8081). AJP : 8009 (I changed it to 8010).

Tomcat 管理端口:8005(我将其更改为 8006) HTTP:8080(我将其更改为 8081)。AJP : 8009(我把它改成了 8010)。

Change the port number and the thing will work out for you. See the port number

更改端口号,事情就会为您解决。 查看端口号

回答by morewater

Maybe you can change the port number in tomcat/conf/server.xml

也许你可以在 tomcat/conf/server.xml 中更改端口号

Or you may use netstat(if in windows) to watch what process is already used the port.

或者您可以使用 netstat(如果在 Windows 中)来查看哪个进程已经使用了该端口。

回答by Darshan Patel

1) Check and identify which process is using that ports and kill it if it is used by Java. Sometimes crashing of eclipse led to ports open.

1)检查并识别哪个进程正在使用该端口,如果被Java. 有时 Eclipse 崩溃会导致端口打开。

In Linux,

在 Linux 中,

Check your running ports using : netstat -lnp | grep 8080

使用以下命令检查您正在运行的端口: netstat -lnp | grep 8080

Check your running processes using : ps -Af | grep java

使用以下命令检查您正在运行的进程: ps -Af | grep java

2) In case, you don't want to affect that running process then you can change ports by editing TOMCAT_HOME/conf/server.xml

2) 如果您不想影响正在运行的进程,那么您可以通过编辑来更改端口 TOMCAT_HOME/conf/server.xml

Refer How to change tomcat default port.

请参阅如何更改 tomcat 默认端口