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