work hard work smart

专注于Java后端开发。 不断总结,举一反三。
随笔 - 1158, 文章 - 0, 评论 - 153, 阅读 - 186万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

Spring 部署Tomcat 404 错误解决方案

Posted on   work hard work smart  阅读(19499)  评论(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文件

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

 

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

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

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

2.详细错误

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

 解决方法

1
2
3
4
5
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

 

编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
历史上的今天:
2013-03-27 [转]JSONObject与JSONArray的使用 .
2012-03-27 ContextMenu的使用
2012-03-27 Metro Style App开发快速入门 之文件选择总结
2011-03-27 数据结构和算法
点击右上角即可分享
微信分享提示