Announcement Announcement Module
Collapse
No announcement yet.
Error when using @EJB class UserDetailsService Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error when using @EJB class UserDetailsService

    Hi, I'm new here...

    I'm trying to use @EJB in Class UserDetailsServiceImpl - using Spring Security 3.1.3

    for example:

    Code:
    @Service(value="userDetailsServiceImpl")
    public class UserDetailsServiceImpl implements UserDetailsService , UsersService{
    	
    	@EJB
    	private UsersDAO usersDAO;
    	
    	@Transactional(readOnly=true)
    	@Override
    	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    		return getFindByUserName(username);
    	}
    
    	@Override
    	public Users getFindByUserName(String username) {
    		return usersDAO.getFindByUserName(username);
    	}
    Error log

    Code:
    INFO: ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [br.com.dentalclinic.dao.users.UsersDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.ejb.EJB(beanName=, mappedName=, beanInterface=class java.lang.Object, description=, name=, lookup=)}
    	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:301)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1073)
    
    
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [br.com.dentalclinic.dao.users.UsersDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.ejb.EJB(beanName=, mappedName=, beanInterface=class java.lang.Object, description=, name=, lookup=)}
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)

    Help me!!
Working...
X