错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

首先,我这里测试了底层代码是没有错的,所以报500我可以确定是springmvc出了错误
错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
思路分析:首先mvc错误首先能想到的就是前置控制器出现错误,所以我们去检查前置控制器。错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
这里我们可以区域的确是整合后的applicationcontext.xml所以应该不是没有注入bean。
springmvc还要配置springmvc.xml,我们去那看看
错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
发现也没有错误,所以我们这里去controller寻找问题,结果也没发现问题。
错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
这时候我按照错误信息发现了我的 <context:property-placeholder location=“database.properties”/> 没有加入classpath:,奇了怪,但是测试类明明可以用的,不管那么多先加上,发现测试成功
错误500分析:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
总结:以后500要仔细看错误信息提示,不然自己找半天有点蠢。。。