欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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框架所要求的,这里记录下错误。

相关标签: 调试