其他分享
首页 > 其他分享> > mybatis: Property 'configuration' and 'configLocation' can not specified with to

mybatis: Property 'configuration' and 'configLocation' can not specified with to

作者:互联网

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentService': Unsatisfied dependency expressed through field 'studentMapper'; 
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentMapper' defined in file [D:\javaproject\demo\target\classes\com\wang\demo\mapper\StudentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.IllegalStateException: Property 'configuration' and 'configLocation' can not specified with together
	

很长的一段错误,我们直接看最后,最后的才是最基础的错误原因,之前的都是由他引发的。

Property 'configuration' and 'configLocation' can not specified with together

configuration和configLocation不能同时存在

看来只能把所有的设置写在mybatis-config.xml里了!

标签:exception,configLocation,factory,together,nested,springframework,org,configurati
来源: https://www.cnblogs.com/wangstudyblog/p/15375943.html