티스토리 뷰
[스프링부트] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.nio.file.FileSystemNotFoundException] with root cause
개발자와코더사이가 PM일까? 2020. 9. 23. 13:40Spring Boot(스프링부트)에서 ClassPathResource을 이용하여 jar 파일 내부에서 있는 파일을 읽어오도록 개발을 했는데 노트북에서는 이상없이 작동하는데.. 서버에만 배포를 하면 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.nio.file.FileSystemNotFoundException] with root cause 오류가 계속해서 발생했다.
오류 원인을 열심히 찾아 보니 스프링부트와 같이 war, jar 파일 내부에 있을 경우에는 toFile() 같은 것을 사용하지 말고 inputStream 같은 것을 사용하라고 이야기가 나왔다.
별거 아니지만 거의 반나절이 없어졌다.
stackoverflow.com/questions/25869428/classpath-resource-not-found-when-running-as-jar
Classpath resource not found when running as jar
Having this problem both in Spring Boot 1.1.5 and 1.1.6 - I'm loading a classpath resource using an @Value annotation, which works just fine when I run the application from within STS (3.6.0, Windo...
stackoverflow.com
- Total
- Today
- Yesterday
- 이클립스
- 가평여행
- 오라클
- 임자도
- jdk
- 담양 죽녹원
- 테라로사
- 정동지
- ora-01940
- PPTX
- java api
- 맛집
- 대관령양떼목장
- 토드
- pdf ms워드 변환
- 부천역
- 제주도여행
- 밀리세컨드
- 인스타그램
- oracle
- 덤프
- 인천
- 보성녹차밭
- 가평팬션
- 산외한우마을
- 파주여행
- 인천여행
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |