MybatisTest No qualified bean for mapper

Skip to first unread message

Daniel Cosio

Dec 1, 2021, 6:51:26 PM12/1/21
to mybatis-user
I'm putting together a small unit test in a spring boot app.
spring-boot: 2.6.1
Junit 5: 5.8.0

I've been following the instructions on mybatis-autoconfigure

Im not having any luck getting the test to work. If I add a @SpringBootApplication as noted in the link I provided I get 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type error

If I remove the @SpringBootApplication I get:
Neither @ContextConfiguration nor @ContextHierarchy found for test class [fehrm.servicelayer.mapper.EnqueueStatusDaoTest], using SpringBootContextLoader

Here is my Test class: Im using H2 for the db.. 




public class EnqueueStatusDaoTest {


private EnqueueStatusDao enqueueStatusDao;


public void testSelect()


EnqueueStatus es = enqueueStatusDao.selectEnqueuePatient("1000000050");



Kazuki Shimizu

Dec 11, 2021, 1:00:18 PM12/11/21
to mybatis-user
Could you provide reproduce project?

2021年12月2日木曜日 8:51:26 UTC+9
Reply all
Reply to author
0 new messages