报错Error configuring application listener of class org.springframework.web.context.ContextConfigLocat...

本文详细解析了在Spring MVC项目中遇到的404错误,主要原因是web.xml中监听器配置错误,将ContextConfigLocation误用为ContextLoaderListener的类名。正确配置应为<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>。文章提供了正确的配置示例,帮助开发者避免此类常见错误。

错误内容是ClassNotFoundException: org.springframework.web.context.ContextConfigLocationdao导致一运行项目就是404

是因为配置在web.xml的listen时不对

应该是

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

我写的是

      ContextConfigLocation

<listener>
<listener-class>org.springframework.web.context.ContextConfigLocation</listener-class>
</listener>

转载于:https://www.cnblogs.com/wth21-1314/p/10468573.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值