关于报错Application run failed
Unsatisfied dependency expressed through field 'ucenterMemberService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ucenterMemberServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ucenterMemberMapper' defined in file [*Mapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
发现是该模块有进行数据库操作但是我取消了数据源的自动装配
application.yml中是有数据库连接的
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//取消数据源自动配置
解决方法是:
@SpringBootApplication
将exclude = DataSourceAutoConfiguration.class删除就可以
二就是@mapper没加或者是@MapperScan的扫描路径问题