我在实现UserProfileService
的类中声明AuthenticationProvider
字段,如下所示:
public class AdAuthenticationController implements AuthenticationProvider {
private UserProfileService userProfileService;
}
不知何故提到错误UserProfileService cannot be resolved to a type
。我正在使用Spring Security 3.1.3版,这个错误的任何线索?
答案 0 :(得分:0)
我怀疑缺少Spring注释@Autowired将此服务注入Controller。试试这个:
public class AdAuthenticationController implements AuthenticationProvider {
@Autowired
private UserProfileService userProfileService;
}