Wrong namespace. Expected 'com.example.springboot.mapper.DepartmentMapper' but found 'com.sandystar.

Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected ‘com.example.springboot.mapper.DepartmentMapper’ but found ‘com.sandystar.jbaby.dao.DepartmentMapper’

Error creating bean with name ‘departmentController’: Unsatisfied dependency expressed through field ‘departmentService’; nested exception is org.springframework

1.这个就是mapper找不到正确的namespace。更改即可。如果这个错误,也有可能直接导致后面的找不到那个bean:“departmentController”。

2.还有就是如果找不到controller类 的bean,那么你就要
(1)在类上添加@Restcontroller

@RestController
@RequestMapping("/department")

@RequestMapping("/department") -->>这个呢,最好就添加一下,区别一下下面你实现对应功能的操作所要寻求的路径。个人觉得比较好
(2)在mapper类前添加

**@mapper**

(3)在实现类(例如:DepartmentServiceImpl)上添加

@Component("DepartmentServiceImpl")//spring的配置
@Service

(4),详情呢,请看下面的图片。

在这里插入图片描述
(5)不懂的呢》请在评论区留下你的小脚脚吧!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值