2014-12-02 138 views
0

UserProfileService领域实现AuthenticationProvider类声明,如下所示:如何解决未解决的UserProfileService?

public class AdAuthenticationController implements AuthenticationProvider { 

    private UserProfileService userProfileService; 
} 

不知有错误提UserProfileService cannot be resolved to a type。我正在使用Spring Security 3.1.3版本,对此错误提供任何线索?

+0

它在类路径中吗?你输入了吗? – holmis83 2014-12-02 10:13:34

+0

@ holmis83是的。它是。 – huahsin68 2014-12-04 10:37:28

回答

0

我怀疑缺少Spring注释@Autowired,它将这个服务注入到Controller中。试试这个:

public class AdAuthenticationController implements AuthenticationProvider { 

    @Autowired 
    private UserProfileService userProfileService; 
} 
+0

这不适合我。 – huahsin68 2014-12-04 10:36:48