Environment: spring3.1.1+mybatis3.2.8+mybatis-spring1.2.3
SPRINGMVC + MyBatis Integration, the following error occurred:
Org.springframework.web.util.NestedServletException:Request processing failed; Nested exception is org.apache.ibatis.binding.BindingException:Invalid bound statement (not found): Org.com.mars.dao.test.UserDao.queryUserById
The possible causes are:
1. Verify that the Mapper.xml file path is configured correctly.
<!--Create sqlsessionfactory and specify data source-- <bean id= "sqlsessionfactory" class= " Org.mybatis.spring.SqlSessionFactoryBean "> <property name=" DataSource "ref=" DataSource "/> <! --Automatically scan the entity directory, eliminating manual configuration in Configuration.xml--- <property name= "mapperlocations" value= "classpath*:maper/* . Map.xml "/></bean>
2. the namespace problem in Mapper.xml.
The value should be *dao.java
<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE Mapper Public "-//mybatis.org//dtd mapper 3.0//en" "Http://mybatis.org/dtd/mybatis-3-mapper.dtd" >< Mapper namespace= "Org.com.mars.dao.test.*dao" > ...</mapper>
For detailed configuration file contents, please refer to:
Reference: http://my.oschina.net/wangbiglei/blog/489597
If this article is not positive, please point out.
above.
Org.apache.ibatis.binding.BindingException