Java 在localhost启动Apache Tomcat v7遇到ap?r?o?b?l?e?m,在eclipse中启动失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21966756/
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 Apache Tomcat v7 at localhost has encountered a p?r?o?b?l?e?m and failed to start in eclipse
提问by user2576371
I'm using Eclipse kepler and Tomcat v7 64 bit on my windows 7 PC. My apache tomcat was running fine but suddenly it stopped working and shows the following error
我在 Windows 7 PC 上使用 Eclipse kepler 和 Tomcat v7 64 位。我的 apache tomcat 运行良好,但突然停止工作并显示以下错误
"Starting Apache Tomcat v7 at localhost has encountered a problem. Server Apache Tomcat v7 has failed to start."
“在 localhost 启动 Apache Tomcat v7 遇到问题。服务器 Apache Tomcat v7 启动失败。”
I have tried deleting the .snap file and temp0 folder in the workspace folder. I have also tried uninstalling and re-installing apache. i referred to the question "Server Tomcat v7.0 Server at localhost failed to start" without stack trace while it works in terminaland tried all solutions.
我曾尝试删除工作区文件夹中的 .snap 文件和 temp0 文件夹。我也尝试过卸载并重新安装 apache。当它在终端中工作并尝试了所有解决方案时,我提到了没有堆栈跟踪的问题“本地主机上的服务器 Tomcat v7.0 服务器无法启动”。
But all this in vain. There is no other process running on port number 8080 or other ports. Tomcat doesn't start only in Eclipse
但这一切都是徒劳的。没有其他进程在端口号 8080 或其他端口上运行。Tomcat 不仅仅在 Eclipse 中启动
采纳答案by Scott
Try checking the Console tab of Eclipse to get more detail of what caused the error. There are several potential problems that could produce this symptom.
尝试检查 Eclipse 的控制台选项卡以获取有关导致错误的原因的更多详细信息。有几个潜在的问题可能会产生这种症状。
On the Console tab, there will be plenty of red text for "INFO" entries in the log, but likely there will be a "SEVERE" entry that explains what happened. You may have to look down a little further because the first one may list that it is "caused by" something else.
在控制台选项卡上,日志中的“INFO”条目将有大量红色文本,但可能会有一个“SEVERE”条目解释发生的情况。您可能需要再往下看一点,因为第一个可能会列出它是由其他原因“引起”的。
In my case, I had refactored the name of a Servlet, but accidentally left the mapping to the old name (e.g., @WebServlet("/SavePost"). This resulted in two servlets being mapped to the same url-pattern, which caused the error:
就我而言,我重构了 Servlet 的名称,但不小心将映射保留为旧名称(例如,@WebServlet("/SavePost")。这导致两个 servlet 被映射到相同的 url-pattern,从而导致错误:
Caused by: java.lang.IllegalArgumentException: The servlets named [forum.SavePost] and [forum.SavePost_old] are both mapped to the url-pattern [/SavePost] which is not permitted
回答by DARSHAN MKWN
If eclipse shows like this: starting tomcat v7.0 server at localhost has encountered a problem port 8080. default port number of tomcat is 8080. if oracle install in your system then you need to change oracle port number. connect with user sysdba and change HTTP port number of oracle SQL command.
如果eclipse显示如下:在localhost启动tomcat v7.0服务器遇到8080端口问题。tomcat默认端口号是8080。如果你的系统安装了oracle,那么你需要更改oracle端口号。与用户 sysdba 连接并更改 oracle SQL 命令的 HTTP 端口号。
SQL> select dbms_xdb.gethttpport as "HTTP-Port", dbms_xdb.getftpport as "FTP-Port" from dual;
HTTP-Port FTP-Port
8080 0
Change Port HTTP and FTP.
SQL> begin
2 dbms_xdb.sethttpport('80');
3 dbms_xdb.setftpport('2100');
4 end;
5 /
SQL> select dbms_xdb.gethttpport as "HTTP-Port"
, dbms_xdb.getftpport as "FTP-Port" from dual;
HTTP-Port FTP-Port
80 2100
回答by Bunny
I used to get this error and were very frustrated because none of the answer were solving problem.
我曾经遇到过这个错误并且非常沮丧,因为没有一个答案能解决问题。
Just see the mappings of servlet this error can be because mapping are not correct
只看servlet的映射这个错误可能是因为映射不正确
Try this it worked for me
试试这个它对我有用