HTTP状态 500 - 内部服务器错误

HTTP状态 500 - 内部服务器错误

问题描述:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from file [D:\imooc-reader\out\artifacts\imooc_reader_Web_exploded\WEB-INF\classes\applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 72; cvc-elt.1: 找不到元素 'beans' 的声明。

尝试过的解决方式:

http://www.springframework.org.schema/beans/spring-beans-4.3.xsd

运行tomcat还是会报错

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小尤 2021-03-18 10:35:42

同学你好,1、 如下所示,在applicationContext.xml的15行中,存在错误,同学可以检查一下,一般情况下,是因为在书写注释时用了 //  ,而xml中并不支持需要用<!----> ,同学可以检查一下是否存在这个问题。

http://img1.sycdn.imooc.com//climg/6052ba2c09f1a42f08940176.jpg

2、如果还存在问题,则建议同学将配置文件头部更换为如下内容再试试:

<?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:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师