cvc-complex-type.2.3: Element 'beans' cannot have character [children]
当启动spring的项目时,有时候会抛如下异常:
Line 33 in XML document from ServletContext resource [/WEB-INF/backend-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.3: Element 'beans' cannot have character [children], because the type's content type is element-only.
异常提示是spring配置文件不能正确解析。
网上搜索了一下,发现都没有给出特别明确的答案
总结了一下,发现出现这种问题时很大一部分原因都是从别处(主要是网络)复制后粘贴到配置文件中的,所以应该和复制内容的编码有关系,或者和内容中有特殊的字符有关系,如果是手工敲入则不会有问题。
另外,如果只是将出问题的行内容清除,然后在问题行上手工输入,还是会有问题,应该是问题行的编码已经乱了,所以一定要删除问题行才行,否则还是会报错的。删除问题行后,在新的行上输入则不会有问题。
所以,如果要从网络复制,可以先复制到word中,word的好处就是可以看到那些网页上看不见的特殊字符,仔细看看有没有特殊字符,将其删除后在复制到配置文件中,这样就不会有问题了。
cvc-complex-type.2.3: Element 'beans' cannot have character [children]相关推荐
- Maven报错解决:Element 'dependency' cannot have character [children], because the type's content type is
在用maven的时候遇到报错: Element 'dependency' cannot have character [children], because the type's content ty ...
- Element 'dependency' cannot have character [children]
问题:Element 'dependency' cannot have character [children], 原因:眼瞎 解决方法:看看你的特殊字符多写.少些.写错. 如下所示: <dep ...
- Element 'dependency' cannot have character [children], because the type's content type is element-on
今天在写Springboot 项目的时候出现以下问题 这个是我在网站上复制的依赖,但是因为格式的错误就会报错,好像还发现不了,所以 我们只需要重新手打一遍就可以了
- Element ‘web-app’ cannot have character [children], because the type’s content type is element-onl
将javaee改为j2ee. 如图
- Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger ...
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'(转)
[applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: C ...
- maven error: element dependency can not have character children
就是Mavn pom.xml的解析错误,因为dependency这个标签中有不可见的垃圾字符,解决方法就是删掉重新打字进去就可以了. references: https://stackoverflow ...
- maven:ment 'dependency' cannot have character [children], because the type's content type is e
应该是空白字符出现了问题,所以自己手打一遍就可以了,
- Spring常见问题
1. Element 'beans' cannot have character [children], because the type's content type is element-only ...
最新文章
- 面试题:mysql 数据类型
- Adobe Flash Builder 4.6 开发环境详解
- 纳尼?我的Gradle build编译只要1s
- Redis普通分布式锁
- ScaleAnimation缩放动画Demo
- 【论文】Realtime lane tracking of curved local road 检测和跟踪功能
- sh脚本异常:/bin/sh^M:bad interpreter: No such file ...
- IDC:2021年云上数据量超过传统数据中心,All in Cloud是趋势
- python 修改图片_Python实现批量修改图片格式和大小的方法【opencv库与PIL库】
- jenkins下载安装及环境搭建
- java实现冒泡排序
- java字符串第一个字母表达_取一个字符串的第一个字母
- Linux的远程管理协议是什么,2-Linux权限与远程管理
- CAS号:60535-02-6,二肽Met-Trp
- 2022 3.17网易互娱研发岗笔试题锯齿数独题解
- PHP微信公众号网页授权登录 扫码登录 获取用户基本信息
- unity基础(3)——从Unity Asset store获取资源
- CSP基础-CSP入门简介
- IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION中的文件过滤
- 南大通用事务型数据库GBase 8s斩获2020年中国国际金融展“金鼎奖”