My controller contains the following annotation :
@Resource(name="userService")
private UserDetailsServiceImpl userService;
and the service itself has the following :
@Service("userService")
@Transactional
public class UserDetailsServiceImpl implements UserDetailsService {
@Resource(name = "sessionFactory")
private SessionFactory sessionFactory;
However I receive the following error on startup :
Injection of resource dependencies
failed; nested exception is
org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named ‘userDetailsServiceImpl’
must be of type
[myapp.service.UserDetailsServiceImpl], but was actually of
type [$Proxy19]
It should be
Spring uses the interface type to make dependency injection, not the implementation type