eclipse “在本地主机上启动 Tomcat 服务器 7 遇到了一个问题”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13185498/
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
"starting Tomcat server 7 at localhost has encountered a prob"
提问by Priyanka
Trying configure tomcat in my eclipse but "Port 8080 required by Tomcat v7.0 Server at localhost 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)". i tried to set up tomcat environment several times but it hitting me with this error any thing i need to do in my eclipse?
尝试在我的 Eclipse 中配置 tomcat,但“本地主机上的 Tomcat v7.0 服务器所需的端口 8080 已在使用中。服务器可能已经在另一个进程中运行,或者系统进程可能正在使用该端口。要启动此服务器,您将需要停止其他进程或更改端口号”。我试图多次设置 tomcat 环境,但它给我带来了这个错误,我需要在 eclipse 中做任何事情吗?
回答by Aleksandr M
In Servers
view double-click on Tomcat and change HTTP port in Ports
section to something else. Or in Package Explorer
navigate to Servers
Tomcat and change Connector
port part inside server.xml
file.
在Servers
视图中双击 Tomcat 并将Ports
部分中的HTTP 端口更改为其他内容。或者Package Explorer
导航到Servers
Tomcat并更改文件中的Connector
端口部分server.xml
。
回答by Zakaria
- Close Eclipse
- Copy all files from TOMCAT/conf to WORKSPACE/Servers/Tomcat v7.0 Server at localhost-config
- Start Eclipse
- Expand the Servers project, click on the Tomcat 7 project and hit F5
- Start Tomcat from Eclipse
- 关闭日食
- 将所有文件从 TOMCAT/conf 复制到 localhost-config 处的 WORKSPACE/Servers/Tomcat v7.0 Server
- 启动日食
- 展开 Servers 项目,单击 Tomcat 7 项目并按 F5
- 从 Eclipse 启动 Tomcat
回答by susi
to overcome this kind of problem follow the steps below:
要克服这种问题,请按照以下步骤操作:
- open command prompt.
- c:\Users\CGITS_04> netstat -o -n -a | findstr 0.0:80
- then you can see a list of process that is currently using port 80.
- open task manager->search the process-> select and end process.
- Now open eclipse and start tomcat.
- happy coding!
- 打开命令提示符。
- c:\Users\CGITS_04> netstat -o -n -a | findstr 0.0:80
- 然后您可以看到当前使用端口 80 的进程列表。
- 打开任务管理器->搜索进程->选择并结束进程。
- 现在打开eclipse并启动tomcat。
- 快乐编码!
回答by Nithyanandan Sathiyanathan
In eclipse->in server tap-> double click on Tomcat server at localhost-> Ports -> HTTP/1.1
在 eclipse->in server tap-> 双击 Tomcat 服务器 at localhost-> Ports -> HTTP/1.1
Default port number will be 8080. Change this to 8081. Tomcat version7.0
默认端口号为 8080。将其更改为 8081。Tomcat version7.0
I have configured tomcat server also in NetBeans IDE 7.4 for JSP. So am facing this issue.
我也在 NetBeans IDE 7.4 中为 JSP 配置了 tomcat 服务器。所以我面临这个问题。
回答by vinayaka cn
Method 1:
方法一:
- type
localhost:8080
in your browser to know which process is taking 8080 port - uninstall that program
- 键入
localhost:8080
您的浏览器知道哪个进程占用8080端口 - 卸载那个程序
Method 2:
方法二:
re-install the apache tomcat BUT during installation change the port number. Watch carefully the installation process
重新安装 apache tomcat 但在安装过程中更改端口号。仔细观察安装过程
回答by beginner
Open the terminal in ubuntu (ctrl+shift+t)
sudo gedit /etc/tomcat7/server.xml
在ubuntu中打开终端(ctrl+shift+t)
sudo gedit /etc/tomcat7/server.xml
change the default port in the server.xml,from 8080 to anything like 8081,8181,8008. Then save the file .
将 server.xml 中的默认端口从 8080 更改为 8081,8181,8008 之类的任何内容。然后保存文件。
Now the project will work nicely without any interruption.
现在该项目将正常运行而不会中断。
回答by Sayeed S. Alam
I was having the same problem when my workspace was in E:\ drive. Then I changed my workspace location to C:\User\\ location. The problem seems to be solved now.
当我的工作区位于 E:\ 驱动器时,我遇到了同样的问题。然后我将我的工作区位置更改为 C:\User\\ 位置。现在问题似乎已经解决了。
回答by Mohamed Moustapha
Go to web.xml
add <element>
before
<web-app>
and close </element>
after </web-app>
去web.xml
添加<element>
之前
<web-app>
和</element>
之后关闭</web-app>
should be somethings like this
应该是这样的
<?xml version="1.0" encoding="UTF-8"?>
<element>
<web-app>
<web-app>
....
</web-app>
</element>
回答by Aziz Ahtas
Hey i got the solution recently... Just copy the "ROOT" folder FROM C:\Program Files\ Apache Software Foundation\ Tomcat 7.0\ webapps \ TO your_Workspace\ .metadata\ .plugins\ org.eclipse.wst.server.core\ tmp0 \wtpwebapps\ and over write it when asked..
嘿,我最近得到了解决方案......只需从 C:\Program Files\ Apache Software Foundation\ Tomcat 7.0\ webapps \ TO your_Workspace\ .metadata\ .plugins\ org.eclipse.wst.server.core 复制“ROOT”文件夹\ tmp0 \wtpwebapps\ 并在询问时覆盖它..
This is needed because eclipse forgets to copy that root folder to its workspace.. Just right click on Apache tomcat 7.0 in servers tab and observe that in location will be workspace metadata by default example:"location:[workspace metadata]". Therefore it will find the root folder which has the welcome page in it and the 404 page not found error will be displayed. Thankyou ..
这是必需的,因为 eclipse 忘记将该根文件夹复制到其工作区。只需右键单击服务器选项卡中的 Apache tomcat 7.0 并观察默认情况下,位置将是工作区元数据,例如:“位置:[工作区元数据]”。因此,它将找到其中包含欢迎页面的根文件夹,并会显示 404 页面未找到错误。谢谢 ..
回答by user3885662
nop... just open the four dateis: content.xml; server.xml; tomcat-users.xml and web.xml in the tap servers. There are some text. Change the number of port 8080 to 8081
nop...只要打开四个dateis: content.xml; 服务器.xml; Tap 服务器中的 tomcat-users.xml 和 web.xml。有一些文字。将端口号 8080 改为 8081