idea+mybatis plus环境: Error creating bean with name ‘orderController‘: Unsatisfied dependency...

博主分享了在使用SpringBoot和MybatisPlus时遇到的mapper路径问题,通过修正扫描路径解决了启动问题,适合刚接触者参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先晒我的问题:
在这里插入图片描述

网上有很多这种错误的解决方法,一般是映射问题(就是没加注解@Service或者@Mapper,@Controller等等)
我寻思我用idea,springboot+mybatisPlus应该不会没加注解呀,
然后我看了一下启动类,发现
扫描mapper的路径不对(就是@MapperScan中我的路径出现了错误,)
自己修改后成功运行。
在这里插入图片描述

08:47:58.265 [restartedMain] ERROR o.s.b.w.e.t.TomcatStarter - [onStartup,61] - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'jwtAuthenticationTokenFilter': Unsatisfied dependency expressed through field 'userLoginService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userLoginService': Unsatisfied dependency expressed through field 'permissionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysPermissionService': Unsatisfied dependency expressed through field 'menuService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysMenuServiceImpl': Unsatisfied dependency expressed through field 'menuMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysMenuMapper' defined in file [/Users/karl/dev/idea_space/jincheng/yclearn/edu-system/target/classes/com/edu/system/mapper/SysMenuMapper.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 [com/edu/framework/config/MyBatisConfig.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 org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [/Users/karl/dev/idea_space/jincheng/yclearn/edu-system/target/classes/mapper/report/StuReportMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error p
03-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值