티스토리 뷰
error log
[스프링오류] Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed;
daeuun 2021. 8. 3. 17:31에러메세지
Context initialized 이벤트를 [org.springframework.web.context.ContextLoaderListener] 클래스의 인스턴스인 리스너에 전송하는 동안 예외 발생
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed;
에러메세지 상세
nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is '/mappers/booklist-mapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Book'. Cause: java.lang.ClassNotFoundException: Cannot find class: Book
원인
mapper파일에서 type alias 'Book' 찾지못해서 발생하는 오류
해결방법
mybatis-config.xml에서 해당 alias를 별칭으로 추가해준다
<typeAliases>
<typeAlias type="com.bookforyou.bk4u.book.model.vo.Book" alias="Book"/>
</typeAliases>
나는 이미 추가되어 있는데 오류가 생겨서 프로젝트 클린했더니 다시 잘 작동했다;; 왜자꾸 이러는거야
반응형
'error log' 카테고리의 다른 글
[Mybatis] There is no getter for property named 오류 (0) | 2021.08.05 |
---|---|
[Oracle] 무결성 제약 조건에 위배됩니다 (0) | 2021.08.04 |
[스프링 오류] DataIntegrityViolationException (0) | 2021.07.29 |
[스프링 오류] java.lang.IllegalArgumentException (0) | 2021.07.29 |
[스프링 오류] java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for (0) | 2021.07.28 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- MultipleBagFetchException
- 오블완
- 티스토리챌린지
- 자바 어플리케이션 실행 과정
- JPA
- port
- bucket4j
- array
- Linux
- spring boot 3
- Kotlin
- addFilterBefore
- ChatGPT
- 스프링 스케줄링
- redisson 분산락
- Git
- dto 클래스 생성자
- n+1
- Java
- Spring Security
- FetchJoin
- Cannot construct instance of
- 스프링오류
- 배열
- MongoDB
- 추상클래스
- QueryDSL
- junit5
- checkout
- jvm warm-up 전략
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
글 보관함