< 에러 메시지 >
SEVERE: Context initialized 이벤트를 [org.springframework.web.context.ContextLoaderListener] 클래스의 인스턴스인 리스너에 전송하는 동안 예외 발생
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'joinController': Unsatisfied dependency expressed through field 'joinService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'joinService': Unsatisfied dependency expressed through field 'memberRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberRepository' defined in file [C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\pf_jun01\WEB-INF\classes\com\portfolio\www\auth\mybatis\MemberRepository.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\pf_jun01\WEB-INF\classes\context-beans.xml]: Invocation of init method failed; nested exception is java.io.IOException: Failed to parse mapping resource: 'file [C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\pf_jun01\WEB-INF\classes\sql\SQL.Board.xml]'
< 원인 >
controller -> service -> repository -> mybatis -> dto
joinController 빈을 생성하는 동안 joinService 필드에 있는 의존성을 해결하는데 실패.
이유는 joinService가 memberRepository에 의존하고, memberRepository가 sqlSessionFactory에 의존하는데 sqlSessionFactory를 초기화하는 동안 SQL.Board.xml 파일을 파싱하는 데 실패
SQL.Board.xml 파일을 파싱하는 동안에는 BoardDto라는 클래스를 찾을 수 없다는 오류가 발생
< 해결 >
mybatis-config에 Board용 경로 추가로 해결
<typeAliases>
<package name="com.portfolio.www.auth.dto" />
<package name="com.portfolio.www.forum.notice.dto" />
</typeAliases>
'에러 모음' 카테고리의 다른 글
[MyBatis] MyBatisSystemException, BindingException (0) | 2024.06.07 |
---|---|
[Spring Framework] BeanDefinitionParsingException (0) | 2024.06.07 |
[Spring Framework] UnsatisfiedDependencyException (0) | 2024.05.29 |
ServletException (0) | 2024.05.23 |
NoSuchBeanDefinitionException, UnsatisfiedDependencyException (0) | 2024.05.23 |