No found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:

后端 未结 13 858
时光说笑
时光说笑 2020-12-08 01:43

I am trying to write a SOAP service using Spring, however I receive a Dependency Injection issue. I\'m having problems using @Autowired through the Service like

13条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 02:20

    Add the annotation @Repository to the implementation of UserDaoImpl

    @Repository
    public class UserDaoImpl implements UserDao {
        private static Log log = LogFactory.getLog(UserDaoImpl.class);
    
        @Autowired
        @Qualifier("sessionFactory")
        private LocalSessionFactoryBean sessionFactory;
    
        //...
    
    }
    

提交回复
热议问题