org.springframework.beans.factory.BeanNotOfRequiredTypeException must be of type

weixin_33872660發表於2016-07-06

http://stackoverflow.com/questions/8391944/getting-spring-error-bean-named-x-must-be-of-type-y-but-was-actually-of-ty

org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'british' must be of type [service.British], but was actually of type [com.sun.proxy.$Proxy9]

解決辦法:在applicationContext.xml中新增<aop:config proxy-target-class="true"/>設定為CGLIB代理就好

相關文章