首页 > 其他分享 >Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through

Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through

时间:2024-06-23 14:44:42浏览次数:3  
标签:Unsatisfied userServiceImpl creating baseMapper boot MyBatis SqlSession through 

 

原因是:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required,检查一下这两个类是干什么的:

SqlSessionFactory 是 MyBatis 的重要对象之一,是创建 SqlSession 的工厂。

SqlSessionTemplate 是 MyBatis-Spring 的核心,是 MyBatis 为了接入 Spring 提供的 Bean,这个类负责管理 MyBatis 的 SqlSession。

这两个类都在mybatis-spring-boot-starter包中,之前有看到文章说使用mybatis-plus之后就不用使用mybatis了,现在看显然不行,我把mybatis-spring-boot-starter引进来之后,项目直接运行成功了,如下图所示↓

image

标签:Unsatisfied,userServiceImpl,creating,baseMapper,boot,MyBatis,SqlSession,through,
From: https://www.cnblogs.com/wenwenlee/p/18263433

相关文章