Spring Autowiring only works with Interface

前端 未结 6 912
慢半拍i
慢半拍i 2020-12-16 13:53

I am quite new to spring framework and came across the following issue.

I have an interface ClassA, which is implemented by classed ClassA1

6条回答
  •  半阙折子戏
    2020-12-16 14:23

    If your objects are proxied by JDK proxies, then they should be referred to by their interface. You can make proxies by concrete class using CGLIB (on the classpath) and proxy-target-class="true" in your aop configuration (in applicationContext.xml)

提交回复
热议问题