使用@Autowired注入时不能直接注入到实现类上,而是注入到接口。
例: AServiceImpl实现了BService接口
@Autowired
private AServiceImpl test
就会出现UnsatisfiedDependencyException …but was actually of type ‘com.sun.proxy.$Proxy**‘异 常
改为:
@Autowired
private BService test 即可解决问题。
使用@Autowired注入时不能直接注入到实现类上,而是注入到接口。
例: AServiceImpl实现了BService接口
@Autowired
private AServiceImpl test
就会出现UnsatisfiedDependencyException …but was actually of type ‘com.sun.proxy.$Proxy**‘异 常
改为:
@Autowired
private BService test 即可解决问题。