I have configured MapperScannerConfigurer
in spring application context as follow:
<bean name="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<property name="basePackage" value="path.to.package.from.classpath.dao" />
</bean>
Here basePackage
is in a jar file that is set in classpath.
One of the mapper from the package is autowired in the one of the services I am using. Looks like MyBatis is failing here to scan package from classpath as I am getting error stating no such Bean found:
No qualifying bean of type 'path.to.package.from.classpath.dao.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate.
I have searched online and found nothing which has similar scenario.