but was actually of type 'com.sun.proxy.$Proxy18'
程序员文章站
2022-06-03 23:14:47
...
ssm项目中遇到了如下问题:
org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named 'areaServiceImpl' is expected to be of type
'com.imooc.o2o.service.impl.AreaServiceImpl'
but was actually of type 'com.sun.proxy.$Proxy18'
看了这篇文章才知道原文章
我在AreaController中:
@Autowired
private AreaServiceImpl areaService;
应该改为
@Autowired
private AreaService areaService;
这是由于SpringMVC框架所要求的,这里记录下错误。
推荐阅读
-
but was actually of type 'com.sun.proxy.$Proxy**'的两种解决方法
-
but was actually of type 'com.sun.proxy.$Proxy16'
-
spring中动态代理 but was actually of type [com.sun.proxy.$Proxy18]
-
解决使用@AutoWired注入出现的but was actually of type 'com.sun.proxy.$Proxy**问题
-
关于 but was actually of type 'com.sun.proxy.$Proxy14'
-
but was actually of type ‘com.sun.proxy.$Proxy**‘ AOP事务代理混用
-
but was actually of type 'com.sun.proxy.$Proxy18'
-
Bean named ‘Target‘ is expected to be of type ‘com.itheima.aop.Target‘ but was actually of type ‘com
-
**Bean named 'XXX' is expected but was actually of type 'com.sun.proxy.$Proxy**'的两种解决方法**
-
声明式事务配置报错:but was actually of type 'com.sun.proxy.$Proxy**'解决