org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException 前言中不允许有内容 来自类路径资源的XML文档中的第1行是无效的
今天复习一下Spring和Hibernate的整合,遇到了一个问题,报错信息如下:
org.springframework.beans.factory.xml。XmlBeanDefinitionStoreException:来自类路径资源的XML文档中的第1行是无效的;嵌套异常
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from class path resource [] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。
根据其意思是XML的文件出现了问题,网上说的问题是 更改xml文件的编码、xml文件第一行有空格 等,折腾了几次,最后发现是没有指定解析哪个xml文件。(如图)
1. 错误:未指定xml文件路径
2. 正确
总结:这个问题折腾了不少时间,算是为自己的马虎大意付出了代价。
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException 前言中不允许有内容 来自类路径资源的XML文档中的第1行是无效的的更多相关文章
- 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]
报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined ...
- aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleDaoImpl' ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is
在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [app2.xml]: Instantiation of bean failed; nested exception is org.spr
在学习spring整合hubernate时遇到的问题.c3p0遇到了一个问题,老连不上,显示java.lang.NoClassDefFoundError:com.mchange.v2.ser.Indi ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deptDao_a' defined in class path resource [beansAndHibernate.xml]: Cannot resolve reference to bean 'sessionFact
Error creating bean with name 'deptDao_a' defined in class path 因为更改了类的名字,所以其setter方法没有更改,需要 private ...
- Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed
- 开发Spring过程中几个常见异常(二):Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'a' define
本异常是小编在运行自己另外一篇博文中的例子时遇到的.(附博文:http://www.cnblogs.com/dudududu/p/8482487.html) 完整异常信息: 警告: Exception ...
- java项目报错: org.springframework.beans.factory.BeanCreationException找不到mapper.xml文件
错误代码 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSer ...
随机推荐
- 如何防止sql注入
注入法: 从理论上说,认证网页中会有型如: select * from admin where username='XXX' and password='YYY' 的语句,若在正式运行此句之前,如果没 ...
- NSTimer用法,暂停,继续,初始化
NSTimer用法,暂停,继续,初始化 转载:http://blog.csdn.net/zhuzhihai1988/article/details/7742881 NSTimer的使用方法 1.初始化 ...
- PHP函数补完 - var_export
var_export() 函数返回关于传递给该函数的变量的结构信息,它和 var_dump() 类似,不同的是其返回的表示是合法的 PHP 代码.var_export必须返回合法的php代码, 也就是 ...
- (转)重磅出击:MongoDB 3.0正式版即将发布
MongoDB 今天宣布 3.0 正式版本即将发布.这标志着 MongoDB 数据库进入了一个全新的发展阶段,提供强大.灵活而且易于管理的数据库管理系统. MongoDB 3.0 在性能和伸缩性方面都 ...
- Java 三大主流框架概述
Struts.Hibernate和Spring是我们Java开发中的常用关键,他们分别针对不同的应用场景给出最合适的解决方案.但你是否知道,这些知名框架最初是怎样产生的? 我们知道,传统的Java W ...
- Object-C类目(Category)
类目是Object-C中最有用的一个特性.实质上,类目允许你为一个已存在的类添加一些方法而不用子类化该类,也不需要你了解该类的实现细节. 这是特别有用的,因为你可以给一个内建的对象添加方法.当你想在你 ...
- object C—类中函数的调用
Object C-类中函数的调用 创建,三个类.然后,在代码中调用相同名字的函数.观察他们的调用次序. @interface test : NSObject - (void)print; @end @ ...
- layout cannot be resolved or is not a field
去除代码activity代码页面顶部中的 import android.R;这句就可以消除红色波浪线的main cannot be resolved or is not a field类似这个错误了
- Ubuntu上搭建DokuWiki
1.准备工作 1) 安装Apache sudo apt-get install apache2 2)在浏览器中输入http://localhost 如果现实It works则说明Apache安装成功, ...
- [HNOI 2002]彩票
Description 某地发行一套彩票.彩票上写有1到M这M个自然数.彩民可以在这M个数中任意选取N个不同的数打圈.每个彩民只能买一张彩票,不同的彩民的彩票上的选择不同. 每次抽奖将抽出两个自然数X ...