Spring配置文件报错问题
项目中Spring的各种配置文件报错,在左边处显示红叉.
问题一:
- 出现这种情况是标签头部有空格!.
问题二:
问题描述:配置文件傍边会报错,就是说找不到这个标签对应的约束等,spring-mvc.xml,spring-mybatis,applicationContext.xml等配置文件都会出现这样的错误.
查阅了网上的资料,说的各种解决方法,比如说是对应的约束jar包没有引入等等解决方案.但是我这里适用.我使用的是Maven来管理jar包的,jar包都存在.
还有就是pom.xml文件中Spring版本与配置文件头部约束中的版本号不对应.我的确实是这个原因.但是我改了版本号还是没用……无奈
最终解决方案
- 注意到把空格删掉,然后把版本号删掉.问题解决.完美运行~
补充:
出现以上错误启动Tomcat会报如下错(部分带代码)
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 63; cvc-elt.1: 找不到元素 'beans' 的声明。
Spring配置文件报错问题相关推荐
- spring 配置文件报错 Cannot resolve class or package
Spring 配置文件报错 Cannot resolve class or package 明明有明确的类但是还会报错 解决:重新 mvn clean install spring 会一次加载所有在x ...
- Spring配置文件报错 :通配符的匹配很全面, 但无法找到元素 ‘context:property-placeholder‘ 的声明
在Spring导入连接数据库的配置文件的时候,使用idea创建配置文件有时候会报XmlBeanDefinitionStoreException异常. <?xml version="1. ...
- Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
在使用Spring AOP时,遇到如下的错误: Exception in thread "main" java.lang.ClassCastException: com.sun.p ...
- spring运行报错--org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 73; cvc-elt.1: 找不到元素 bean的声明
关于spring运行报错 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML do ...
- 解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp
解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp ...
- dubbo之.xml配置文件报错
[dubbo之.xml配置文件报错]Multiple annotations found at this line: - cvc-complex-type.2.4.c: The 异常现象: 1.dub ...
- Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound;
Spring data报错:Inferred type 'S' for type parameter 'S' is not within its bound; 参照 org.springframewo ...
- Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService ‘applicationTaskExecutor‘
问题 Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 原因 ...
- 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程
启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...
最新文章
- Java矩阵计算之EJML
- flex 文字竖排_flex button字竖排展示
- 十五天精通WCF——第十一天 如何对wcf进行全程监控
- html里meta标签,HTML中的meta标签详解
- 苹果新一代 AirPods 能活过两年吗?
- sed修炼系列(二):sed武功心法(info sed翻译+注解)
- int.Parse(),int.TryParse(),Convert.ToInt32(), (int)转换为数字类型方法简介
- 毕业题目:Matlab GUI界面
- linux长ping然后保存,Linux下长时间ping网络加时间戳并记录到文本
- android dex文件是什么,关于android:apk文件中classes.dex文件的作用
- Maven的基本概念(三)
- 百度bae部署html,百度BAE使用:应用配置文件 app.conf
- 26个手写大写字母图片
- Windows Server 2012 磁盘管理
- java接口保存文件到本地指定目录下
- 个人精心整理的前端学习开发实用的网站
- 一战成名,用户贷款风险预测 参赛代码与数据集分享
- Echarts实现自定义图标——风向图
- 遍历操作__getitem__
- 消息中间件(一)MQ详解及四大MQ比较