본문 바로가기

Others/Error

[스프링] org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.ibatis.session.SqlSession] found for dependency

[참고] https://okky.kr/article/311759?note=1028840 


config.xml 파일을 별도로 지정해 주었다면

web.xml의 contextConfigLocation에 별도로 지정한 config 파일을 등록해 주었는지 확인해보자.


예)


<servlet>

<servlet-name>appServlet</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<init-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/spring/appServlet/servlet-context.xml

/WEB-INF/spring/mybatis/mybatis-context.xml

/WEB-INF/spring/security/security-context.xml

</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>