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 set(當時自己沒寫這個set)
		etag = #{etag,jdbcType=VARCHAR},
		last_update_time = #{lastUpdateTime,jdbcType=BIGINT}
		where sid = #{sid,jdbcType=VARCHAR}
		and account_id =
		#{accountId,jdbcType=VARCHAR}
	</update>

紀念一下自己的錯!!!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM