springMVC+mybatis 进行单元测试时 main SqlSessionFactoryBean - Parsed configuration file: 'class path resource' 无限的读取xml文件

今天终于写完的Dao层的操作,怀着无比激动的心情,进行单元测试,就在最后一个方法,对的就是最后一个方法,启动单元测试就会报以下错误:

[2016-05-11 18:25:01,691] [WARN ] main BoneCPConfig - Please use setIdleConnectionTestPeriodInMinutes in place of setIdleConnectionTestPeriod. This method has been deprecated.
[2016-05-11 18:25:01,691] [WARN ] main BoneCPConfig - Please use setIdleMaxAgeInMinutes in place of setIdleMaxAge. This method has been deprecated.
[2016-05-11 18:25:01,691] [WARN ] main BoneCPConfig - releaseHelperThreads has been deprecated -- it tends to slow down your application more.
[2016-05-11 18:25:01,753] [DEBUG] main SqlSessionFactoryBean - Parsed configuration file: ‘class path resource [mybatis.xml]‘
[2016-05-11 18:25:01,759] [DEBUG] main BoneCPDataSource - JDBC URL = jdbc:mysql://10.10.8.150:8066/CALENDAR?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true, Username = calendar, partitions = 1, max (per partition) = 5, min (per partition) = 2, idle max age = 20 min, idle test period = 240 min, strategy = DEFAULT
[2016-05-11 18:25:02,283] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AccessTokenInfoMapper.xml]‘
[2016-05-11 18:25:02,302] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AttendeeMapper.xml]‘
[2016-05-11 18:25:02,312] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\BindingUserMapper.xml]‘
[2016-05-11 18:25:02,328] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\PublicLabelMapper.xml]‘
[2016-05-11 18:25:02,338] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\RepeatDeletedMapper.xml]‘
[2016-05-11 18:25:02,385] [DEBUG] main SqlSessionFactoryBean - Parsed configuration file: ‘class path resource [mybatis.xml]‘
[2016-05-11 18:25:02,402] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AccessTokenInfoMapper.xml]‘
[2016-05-11 18:25:02,415] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AttendeeMapper.xml]‘
[2016-05-11 18:25:02,422] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\BindingUserMapper.xml]‘
[2016-05-11 18:25:02,433] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\PublicLabelMapper.xml]‘
[2016-05-11 18:25:02,441] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\RepeatDeletedMapper.xml]‘
[2016-05-11 18:25:02,470] [DEBUG] main SqlSessionFactoryBean - Parsed configuration file: ‘class path resource [mybatis.xml]‘
[2016-05-11 18:25:02,486] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AccessTokenInfoMapper.xml]‘
[2016-05-11 18:25:02,496] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AttendeeMapper.xml]‘
[2016-05-11 18:25:02,502] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\BindingUserMapper.xml]‘
[2016-05-11 18:25:02,511] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\PublicLabelMapper.xml]‘
[2016-05-11 18:25:02,518] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\RepeatDeletedMapper.xml]‘
[2016-05-11 18:25:02,541] [DEBUG] main SqlSessionFactoryBean - Parsed configuration file: ‘class path resource [mybatis.xml]‘
[2016-05-11 18:25:02,561] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AccessTokenInfoMapper.xml]‘
[2016-05-11 18:25:02,571] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\AttendeeMapper.xml]‘
[2016-05-11 18:25:02,578] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\BindingUserMapper.xml]‘
[2016-05-11 18:25:02,587] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\PublicLabelMapper.xml]‘
[2016-05-11 18:25:02,594] [DEBUG] main SqlSessionFactoryBean - Parsed mapper file: ‘file [D:\work\calendarApi\target\classes\com\cn21\calendar\dao\config\RepeatDeletedMapper.xml]‘
[2016-05-11 18:25:02,617] [DEBUG] main SqlSessionFactoryBean - Parsed configuration file: ‘class path resource [mybatis.xml]‘

并且一直循环下去,一直以为是哪里不小心修改了配置文件导致出错,我居然花费了2个小时找出错原因。

最后一口老血喷薄而出,对 就是被自己蠢死的,原因就是因为太兴奋在最后的一个测试中sql写错了

	<!-- 根据主键修改日程etag -->
	<update id="updateEtagByPrimaryKey" parameterType="java.util.map">
		update t_schedule
		etag = #{etag,jdbcType=VARCHAR},
		last_update_time = #{lastUpdateTime,jdbcType=BIGINT}
		where sid = #{sid,jdbcType=VARCHAR}
		and account_id =
		#{accountId,jdbcType=VARCHAR}
	</update>

纪念一下自己的错!!!

springMVC+mybatis 进行单元测试时 main SqlSessionFactoryBean - Parsed configuration file: 'class path resource' 无限的读取xml文件

时间: 2024-10-21 10:58:51

springMVC+mybatis 进行单元测试时 main SqlSessionFactoryBean - Parsed configuration file: 'class path resource' 无限的读取xml文件的相关文章

SpringMVC + Mybatis + Shiro + ehcache时缓存管理器报错。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securit

Spring,SpringMVC,Mybatis等配置文件报错解决(Referenced file contains errors)

今天自己搭建了ssm框架,头文件什么的都是拷贝的笔记的,本来不会出错.可是偏偏报错(如下): Referenced file contains errors (http://www.ibatis.com/dtd/sql-map-config-2.dtd). For more information, right click on the message in the  Problems View and select "Show Details..." 整整折腾了一上午,也没解决.网上

PHP启动时配置文件显示Loaded Configuration File =&gt; (none)

错误示下: php -i | grep Load Loaded Configuration File => (none) libXML Loaded Version => 20901 解决办法: 使用strace去追踪一下: #strace /usr/local/php/bin/php -i 2> /tmp/1.log grep 'php.ini' /tmp/1.log 显示如下信息: open("/usr/local/php-7.0.23/bin/php-cli.ini&qu

学习笔记——Spring+SpringMVC+MyBatis框架整合

一.Maven创建项目 1. 在Eclipse中选择New -> Project -> Maven -> Maven Project 2. 选择默认workspace之后建立maven-webapp 3. 填写Group Id和Artifact Id(项目名称) 4. 建立工程后发现目录结构报错 5. 为了避免乱码,右键点击工程选择Properties -> Resource,选择编码方式为UTF-8 6. 在Properties中选择Java Build Path -> J

Spring+SpringMVC+Mybatis环境的搭建(使用Intellij IDEA)

前言:本文主要介绍利用IDEA如何搭建SSM环境,并使用mybatis的逆向生成功能,根据数据表生成对应mapper接口和sql映射文件.具体步骤如下. 开发环境: IDEA 14.1.7 maven 3.5.2 1.搭建web环境 利用idea搭建web环境的具体步骤,请参考笔者的另一篇博文:使用IntelliJ IDEA和Maven管理搭建Web开发环境(以Spring MVC为例)(一)文中有详细介绍. 2.通过maven添加相关依赖包 搭建ssm环境,需要spring.mybatis.数

Spring+SpringMVC+MyBatis+Maven框架整合

本文记录了Spring+SpringMVC+MyBatis+Maven框架整合的记录,主要记录以下几点 一.Maven需要引入的jar包 二.Spring与SpringMVC的配置分离 三.Spring与MyBatis的整合 一.Maven需要引入的jar包 本文默认读者已经掌握Maven的使用,Maven配置片段如下 Xml代码   <!-- 引入spring-webmvc与spring-jdbc --> <dependency> <groupId>org.sprin

重构Mybatis与Spring集成的SqlSessionFactoryBean(上)

一般来说,修改框架的源代码是极其有风险的,除非万不得已,否则不要去修改.但是今天却小心翼翼的重构了Mybatis官方提供的与Spring集成的SqlSessionFactoryBean类,一来是抱着试错的心态,二来也的确是有现实需要. 先说明两点: 通常来讲,重构是指不改变功能的情况下优化代码,但本文所说的重构也包括了添加功能 本文使用的主要jar包(版本):spring-*-4.3.3.RELEASE.jar.mybatis-3.4.1.jar.mybatis-spring-1.3.0.jar

用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建三:配置spring并测试

这一部分的主要目的是 配置spring-service.xml  也就是配置spring  并测试service层 是否配置成功 用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建二:配置MyBatis 并测试(2 配置spring-dao和测试)在这个基础上面 继续进行spring的配置. 回顾上面  我们已经成功测试通过了Mybatis的配置. 这时候的目录结构是: 一:下面我们继续补充目录结构,在com.peakfortake的文件目录项目 

spring springMVC mybatis 集成

最近闲来无事,整理了一下spring springMVC mybatis 集成,关于这个话题在园子里已经有很多人写过了,我主要是想提供一个完整的demo,涵盖crud,事物控制等. 整个demo分三个层次: 一.简单模式:整个框架的参数传递不使用实体对象,统一用Map来存储变量,对mybatis部分不使用mapper接口,使用SqlSessionDaoSupport 提供的SqlSession 来操作mapper XML文件中的命令.这种方式的好处是框架层次结构很简单,适合快速开发,缺点是没有实