@Resource annotation is not supported on static fields

来源:互联网 发布:阿里云搭建视频教程 编辑:程序博客网 时间:2024/05/01 07:03

@Resource annotation is not supported on static fields  

问题解决


写set方法,在set方法上做注解

@Componentpublic final class OAuthUtil {private static OAuthService oauthService;@Resource(name = "woldoauthService")public void setOauthService(OAuthService oauthService) {OAuthUtil.oauthService = oauthService;}}


0 0
原创粉丝点击