分享一个500异常
发布日期:2021-05-07 13:38:17 浏览次数:11 分类:原创文章

本文共 1482 字,大约阅读时间需要 4 分钟。

在这里插入图片描述
这是个spring相关的项目,很显然错误信息中没有什么有效的信息。报错500说明服务端那边有问题,于是博主在服务端打了个断点,单步执行,发现程序都没进入断点!
最后
我修改了一下applicationContext.xml的头部信息

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns:mvc="http://www.springframework.org/schema/mvc"       xmlns:context="http://www.springframework.org/schema/context"       xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">

那个schemaLocation中的信息很容易被遗漏!
对比原来的xml

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns:mvc="http://www.springframework.org/schema/cache"       xmlns:context="http://www.springframework.org/schema/context"       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

发现原来是mvc:annotation-driver的schemaLocation导入错误。

上一篇:Mybatis逆向工程模板
下一篇:Spring的IOC注入(入门介绍)

发表评论

最新留言

感谢大佬
[***.8.128.20]2025年04月04日 23时09分10秒