title: using MapperScannerConfigurer with spring3, mybatis, and mybatis-spring
body: <p>in my <strong>applicationContext.xml</strong> i have the following</p>
  
  <pre><code>&lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="formularyDb" /&gt;
      &lt;property name="configLocation"  value="file:/web/sites/drugformulary-spring/config/mybatis-config.xml" /&gt;
      &lt;property name="mapperLocations" value="file:/web/sites/drugformulary-spring/mappers/*.xml" /&gt;
      &lt;!--&lt;property name="mapperLocations" value="classpath*:org/myd/formulary/mappers/*.xml" /&gt;--&gt;
  &lt;/bean&gt;
  &lt;bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"&gt;
      &lt;constructor-arg index="0" ref="sqlSessionFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;
      &lt;!--&lt;property name="basePackage" value="org.myd.formulary.drugmaster.dao" /&gt;--&gt;
      &lt;property name="basePackage" value="org.myd.formulary.drugmaster" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>if i have the
  <strong>property name="basePackage" value="org.myd.formulary.drugmaster"</strong>
  , my DAO(DrugMasterDao) in org.myd.formulary.drugmaster.dao is not found I get the *error:</p>
  
  <p>Invalid bound statement (not found): </p>
  
  <p>But if i change it to <strong>property name="basePackage" value="org.myd.formulary.drugmaster.dao</strong>,  DrugMasterDao is found </p>
  
  <p>I would like to have my dao's in the same packages with its controllers and services. So i am wondering how do i do this (use MapperScannerConfigurer) with different dao's in different packages? They will be all under org.myd.formulary</p>