0
我想用Spring註釋來定義控制器,服務和道,但失敗。服務的春天批註
錯誤消息是
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.abs.absbase.ABSService] is defined: Unsatisfied dependency of type [interface com.abs.absbase.ABSService]: expected at least 1 matching bean
但我定義服務。
另一個問題是,如何定義一個sessionfactory來覆蓋ABSDaoImpl中的HibernateDaoSupport?
感謝
源代碼
@Controller
@RequestMapping("/abs.do")
public class ABSController {
@Autowired
@Qualifier("ABSService")
ABSService service;
...
}
@Service(value="ABSService")
public class ABSServiceImpl implements ABSService {
@Autowired
@Qualifier("ABSDao")
ABSDao dao;
}
@Repository(value="ABSDao")
public class ABSDaoImpl extends HibernateDaoSupport implements ABSDao {
...
}
不,不起作用。 – user595234