xml错误——Element 'beans' cannot have character [children],because the type's content type is element

1、问题描述

学习的时候遇到问题:Element ‘beans’ cannot have character [children],because the type’s content type is element-only
报错意思:元素 ‘beans’ 必须不含字符 [子级], 因为该类型的内容类型为“仅元素"。
图片:在这里插入图片描述

2、问题原因

配置文件中的beans节点下面只能是元素节点,不能有字符或文本存在。
在这里插入图片描述
xml文件注释不是//****,在xml出现多余的字符也会报同样的错误

3、解决方法

正确注释内容,检查是否有多余的字符。

发布了8 篇原创文章 · 获赞 27 · 访问量 351

猜你喜欢

转载自blog.csdn.net/qq_44706044/article/details/103813258