work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Spring 部署Tomcat 404 错误解决方案

Posted on 2017-03-27 17:09  work hard work smart  阅读(19466)  评论(2编辑  收藏  举报

将Spring项目部署到tomcat后,访问网页出现404错误

HTTP Status 404 – Not Found The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

 

1. 查看tomcat下的log文件

SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file 

 

在WEB-INF/classes下创建logging.properties文件

org.apache.catalina.core.ContainerBase.[Catalina].level=INFO
org.apache.catalina.core.ContainerBase[Catalina].handlers=java.util.logging.ConsoleHandler

 重启tomcat,之后就能看到全部错误log。

2.详细错误

org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file

 解决方法

Open the project's properties (e.g., right-click on the project's name in the project explorer and select "Properties").
Select "Deployment Assembly".
Click the "Add..." button on the right margin.
Select "Java Build Path Entries" from the menu of Directive Type and click "Next".
Select "Maven Dependencies" from the Java Build Path Entries menu and click "Finish".

  参考:http://stackoverflow.com/questions/6210757/java-lang-classnotfoundexception-org-springframework-web-context-contextloaderl