我在春天的autoconfig魔法中有点迷失。
我看到了这个例外:
Unsatisfied dependency expressed through field 'entryService';
nested exception is
[...].BeanNotOfRequiredTypeException:
Bean named 'entryService' is expected to be of type
'[...].EntryService'
but was actually of type
'com.sun.proxy.$Proxy84'
该bean的课程是:
package ...
@Service
public class EntryService {
// several methods, but no further annotations
}
我不确定为什么春天似乎认为我想要一个代理我的服务?调试这个有什么选择?我怀疑它可能是由AOP autoproxying造成的,我在类路径上有AOP和spring-tx(通过spring-webmvc - > spring-aop和spring-jdbc - > spring-tx拉入)。
编辑=====
为春天开始记录导致了这个:
2018-03-23 11:50:22.421 DEBUG 15483 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2018-03-23 11:50:22.425 DEBUG 15483 --- [ main] o.s.aop.framework.JdkDynamicAopProxy : Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [....EntryService@51dae791]
编辑2 =====
完整的入门服务:
@Service
public class EntryService extends AbstractGuidEntityService<Entry> {
@Override
public Entry get(String guid) {
....
}
}
但在树的任何地方都没有其他特定于春天的注释。