Dev/Spring Framework

ERROR: org.springframework.web.context.ContextLoader - Context initialization failed

Fehoon- 2018. 3. 5. 20:59

 

 

ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DAO': Unsatisfied dependency expressed through field 'session'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.ibatis.session.SqlSession' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}

 

 

 

위와 같은 애러 발생 시 root-context.xml 파일에

 

 <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="clearCache">
 <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg>
 </bean>

 

이 내용이 빠져있는지 확인해보도록 합시다!

반응형