Element 'beans' cannot have character [children],because the type's content type is elem
Posted knightlj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Element 'beans' cannot have character [children],because the type's content type is elem相关的知识,希望对你有一定的参考价值。
配置文件错误—— Element ‘beans‘ cannot have character [children],because the type‘s content type is element
意为 beans 标签下只能存在子元素节点,不能存在文本符号
当编译器放生这种错误时,就是配置文件发生错误。这种错误有两种情况。
1.简单错误:仔细观察代码,有时可能是存在一个文本符号
2.难以发现的错误:核实代码,完全没有文本符号,就有可能是编码问题,将整段拷贝,用notepad++打开,使用ANSI编码格式,就能发现错误。
我走的坑是第二个,拷贝的notepad++上,结果如图 :
utf-8格式下:
ANSI格式下:
使用ANSI编码,就莫名其妙多出这个玩意了,删除即可。
以上是关于Element 'beans' cannot have character [children],because the type's content type is elem的主要内容,如果未能解决你的问题,请参考以下文章
cxf异常but no declaration can be found for element 'jaxrs:client'.
mvc:annotation-driven' must have no character or element问题
Consider defining a bean of type 'com.lvjing.dao.DeviceStatusMapper' in your configuration.(
spring MVC配置,启动报异常:Error creating bean with name 'userDao' defined in URL
关于cvc-complex-type.2.4.d: Invalid content was found starting with element 'mvc:exclude-mapping
元素的属性相关操作element.getAttribute('xxx'),element.setAttribute('xxx','xxx'),eleme