解决mapper接口无法映射mapper.xml

错误信息:22-Mar-2019 15:15:53.542 严重 [http-nio-8080-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hn.mapper.UserMapper.findNameByUser] with root cause
 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hn.mapper.UserMapper.findNameByUser

第一:在spring-mybatis.xml 配置文件中把mybatis主配置文件和接口映射文件配置好

	
	
		
		
		
		
	

第二:把xml中的入参类型去掉

	

 

第三:确认实体类中不能有“有参构造”方法

 

第四:mybatis主配置文件中的配置不能和spring-mybatis中的配置重复.xml 

你可能感兴趣的:(mysql/mybatis)