Org.apache.ibatis.binding.BindingException

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.