org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testController': Unsatisfied dependency expressed through field 'sysUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserMapper' defined in file [C:\Users\Demo\Desktop\vueadmin-java\target\classes\com\huang\vueadminjava\mapper\SysUserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.9.jar:5.3.9]
Bug详细图:
启动类:
Mapper类重复注入了吧。
启动类加了扫描注解,mapper就不用加。
首先你配置文件为什么弄两个application?一个就够了,你的yaml里面写的不对呀,你mybatis_plus都没有扫描实体类包,数据库配置位置也是不对的
你可以参考我的来做
希望对你有所帮助