 <p>in the spring configuration, taking a xml way for example, make sure that the mapper.xml files are located at the place assigned as the value of the property named <code>mapperLocations</code>. Once I had it at mappers/anotherfolder/*.xml. And that causes the pain.</p> <pre><code>&lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt; &lt;property name="dataSource" ref="dataSource"/&gt; &lt;property name="typeAliasesPackage" value="somepackage.model"/&gt; &lt;property name="mapperLocations" value="classpath*:mappers/*.xml"/&gt; &lt;/bean&gt; </code></pre>