gpt4 book ai didi

spring - 无法 Autowiring 字段 : can't to com. sun.proxy.$Proxy22

转载 作者:行者123 更新时间:2023-12-04 23:20:46 25 4
gpt4 key购买 nike

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.cms.service.FolderService com.cms.action.BaseAction.folderService; nested exception is java.lang.IllegalArgumentException: Can not set com.cms.service.FolderService field com.cms.action.BaseAction.folderService to com.sun.proxy.$Proxy22
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:518)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
... 30 more
Caused by: java.lang.IllegalArgumentException: Can not set com.cms.service.FolderService field com.cms.action.BaseAction.folderService to com.sun.proxy.$Proxy22
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:657)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
... 32 more

这是我的基本 Action
public class BaseAction {

@Autowired
protected FolderService folderService;

@Autowired
protected ArticleService fileService;

@Autowired
protected TemplateService themeService;

@Autowired
protected HeadlineService headlineService;

protected final Logger logger = Logger.getLogger(this.getClass());
}

那是我的 FolderService
@Service
public class FolderService {

protected final Logger logger = Logger.getLogger(this.getClass());

@Autowired
private FolderDao folderDao;

@Autowired
private AdminFolderDao adminFolderDao;

...................next is the java method

}

最佳答案

通常这意味着有一个 AOP 代理委托(delegate)给您的 bean。例如,如果您使用 @Transaction 注释了您的方法之一。 .

关于spring - 无法 Autowiring 字段 : can't to com. sun.proxy.$Proxy22,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27540355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com