这是我使用spring 3.2.4,mybatis-spring-1.2.1的第一个mybatis spring mvc应用程序
当我尝试调用我的web服务时,我收到错误::
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.mydomain.formulary.drugmaster.dao.DrugMasterDao.getDrugsWithAlert
我一定错过了一些明显的东西.谢谢你的帮助
以下是我的相关文件: applicationContext.xml
映射文件 - > /classes/org/mydomain/formulary/mappers/drugmasterDao.xml
映射文件 - > /classes/org/mydomain/formulary/drugmaster/dao/DrugMasterDao.java
public interface DrugMasterDao { public ListgetDrugsWithAlert(int count); }
控制器文件 - > /classes/org/mydomain/formulary/drugmaster/controller/DrugMasterController.java
@Controller public class DrugMasterController { @Autowired DrugMasterService drugMasterService; @RequestMapping(value = "/drugmaster/withalerts/count/{count}", method = RequestMethod.GET) public String withAlerts(ModelMap model, @PathVariable int count) { Listdrugs = drugMasterService.getDrugsWithAlert(count); return null/*for now*/; } }
服务文件 - > /classes/org/mydomain/formulary/drugmaster/service/DrugMasterServiceImpl.java
@Service public class DrugMasterServiceImpl implements DrugMasterService { @Autowired DrugMasterDao drugMasterDao; public ListgetDrugsWithAlert(int count){ return drugMasterDao.getDrugsWithAlert(count); } }
mybatis-configfile - >