今天终于写完的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