问答详情
源自:6-1 声明式事务管理方式一:基于TransactionProxyFactoryBean的方式

注入代理类出错

为什么我将代理类注入到测试用的service的时候报错啊,错误内容:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.deppon.service.impl.TestExchangeServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'exchangeServiceProxy' must be of type [org.springframework.transaction.interceptor.TransactionProxyFactoryBean], but was actually of type [$Proxy15]

5711ac6100010d4f05000072.jpg

5711ac610001e06c05000234.jpg

5711ac620001347d05000277.jpg


提问者:peng1990 2016-04-16 11:07

个回答

  • 武zz
    2016-11-11 20:25:49

    Dao和Service的<bean>配置中包名没有改过来

  • ATWJSW
    2016-09-19 13:09:41

    ExchangeService 要用接口类

    @Resource(name="exchangeServiceProxy")

    private ExchangeChangeService exchangeService


  • anthow
    2016-04-16 15:00:05

    Bean named 'exchangeServiceProxy' must be of type [org.springframework.transaction.interceptor.TransactionProxyFactoryBean], but was actually of type [$Proxy15]   是不是导包错误呀   还有就是你的prop的key不再是transfer了,哈哈,这里你需要改成自己的方法啦~