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
For a long period of mistakes, let’s look directly at the last. The last is the most basic reason for the mistakes. The previous ones were caused by him.
Property 'configuration' and 'configLocation' can not specified with together
Configuration and configlocation cannot exist at the same time
It seems that you can only write all the settings in mybatis-config.xml!
Similar Posts:
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- [Solved] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘deptController’: Unsatisfied dependency expressed through field ‘departmentMapper
- Spring cloud consumer feign injection error [How to Solve]
- [Solved] Caused by: java.lang.ClassNotFoundException: org.mybatis.logging.LoggerFactory
- [Solved] Cause: java.lang.ClassNotFoundException: Cannot find class: xxxx
- How to Solve the login error of Spring + Shiro CacheManager
- [Solved] Error creating bean with name ‘xxxxController’: Unsatisfied dependency expressed through field ‘xxxxService’;
- [Solved] Error creating bean with name ‘orderController’: Unsatisfied dependency expressed through field ‘orderService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘com.southwind.mmall002.service.Impl.ProductCategoryServiceImplTest’:
- [Solved] Springboot Use Redis Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘redisTemplate’ defined in class path resource