在编写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.最后的绝招:重新手动抄写一遍文件内容,保存。
---------------------
作者:风火一回
来源:CSDN
原文:https://blog.csdn.net/mafan121/article/details/43266733
版权声明:本文为博主原创文章,转载请附上博文链接!

相关文章:

  • 2021-09-12
  • 2021-04-14
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-08-30
猜你喜欢
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-07-02
  • 2021-11-14
相关资源
相似解决方案