일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 스프링부트 웹 소켓
- 42seoul
- sql
- javascript
- 티스토리챌린지
- 오블완
- 다이어리
- JPA
- 아이패드다이어리
- CI
- 인공지능
- springboot
- 리눅스
- swift
- Xcode
- 소켓
- 데이터베이스
- MySQL
- jenkins
- CD
- IOS
- 스프링
- DBMS
- libasm
- 네트워크
- 오라클
- 스프링부트
- Spring
- 프로그래밍언어론
- AI
- Today
- Total
Hi yoahn 개발블로그
[spring boot] json web token 에러 본문
[spring 오류] Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfig' defined in URL [jar:file:/home/g20181031/serverBuild/croffle-0.1.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/sungshin/croffle/config/SecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'OAuthAuthenticationSuccessHandler' defined in URL [jar:file:/home/g20181031/serverBuild/croffle-0.1.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/sungshin/croffle/config/auth/handler/OAuthAuthenticationSuccessHandler.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tokenProvider': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.sungshin.croffle.config.auth.token.TokenProvider] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@2b71fc7e]
이런 에러가 발생, TokenProvider 클래스에서 오류가 나는것 같았는데, 그 안에 있는 AppProperties 설정을 못받아 오는것 같았다.
로컬에서 실행할때는 오류가 생기지 않는데, jar 파일로 실행만 하면 발생하는 오류였다
<해결방법>
build.gradle 의 디펜던시 문제였다.
기존 build.gradle 의 dependency 목록에 json web token 이 compileOnly 로 되어있었는데, Implementation으로 변경하니까 해결됐다.
<기존코드>
compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
<변경코드>
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
'프로젝트 개발 일지' 카테고리의 다른 글
[42GG] 3기 개발일지 2 (0) | 2023.05.13 |
---|---|
[42GG] 3기 개발일지 1 (0) | 2023.04.21 |
SpringBoot OAuth + JWT (0) | 2022.05.31 |
프로젝트에 젠킨스를 이용한 CI & 자동 배포 적용기 (0) | 2021.08.26 |
[42Seoul] #1 구인구직 서비스 개발기 (0) | 2021.02.22 |