본문 바로가기

DATABASE/Error

[Error] Mybatis SqlSession 오류 - Cannot find class: 패키지명(package)

 

Mapper.xml 에서 해당 경로의 패키지명을 찾지 못 했다는 에러

 

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in ServletContext resourc
[/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:
Failed to parse mapping resource: 'file [C:\Users\~경로\Mapper.xml]';
nested exception is org.apache.ibatis.builder.BuilderException:
Error parsing Mapper XML. The XML location is 'file [C:\Users\~경로\Mapper.xml]'.
Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias
'패키지명'. Cause: java.lang.ClassNotFoundException: Cannot find class: 패키지명

 

 

<mapper namespace="패키지명" > 과

<select id="이름" resultType="패키지명">

 

패키지명 확인 후 수정하면 해결 됨.