cvc-complex-type.2.3: Element 'beans' cannot have character [children] (转载)

来源:互联网 发布:relief f算法 编辑:程序博客网 时间:2024/06/08 08:24

在编写spring的applicationContext.xml文件时,无缘无辜出现了:

cvc-complex-type.2.3: Element 'beans' cannot have character [children], because the type's content type is element-only.错误。


错误原因:Spring在初始化的时候无法识别applicationContext.xml中的元素。

可能产生该错误的原因:网上复制的代码直接粘贴到了xml文件中,而网上的代码可能不符合xml规范


解决办法:1.去掉xml文件中的中文注解,因为复制的有些注解Spring不能识别。 

                  2.若仍然有错,则尝试修改多余的空格,因为中文空格Spring有可能识别错误。

                  3.最后的绝招:重新手动抄写一遍文件内容,保存。

阅读全文
0 0
原创粉丝点击