SpringBoot Cglib代理不生效

启动项目抛出异常:Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'testTableDao' is expected to be of type 'com.TestTableDao' but was actually of type 'com.sun.proxy.$Proxy92'

 

原因:缺少Cglib依赖

解决办法:添加aop依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-aop</artifactId>
</dependency>

  

 

posted @ 2023-03-03 11:34  N!CE波  阅读(158)  评论(0编辑  收藏  举报