mybatis-xml配置错误('configuration' and 'configLocation' can not specified with together)
操作
我在使用mybatis-XML映射配置时,没有将mappper的xml文件放在同名同包的路径下,而是使用辅助配置,在配置文件中设置XML路径.然而,在配置文件后,没有成功,一直报错.
错误信息:
- "Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception with message: Property 'configuration' and 'configLocation' can not specified with together
- Property 'configuration' and 'configLocation' can not specified with together
错误原因
原来是配置文件的配置语句写错了
正确:mybatis.mapper-locations=classpath:mapper/.xml
错误:mybatis.config-location=classpath:mapper/.xml