[PreProject] [Error] [Spring] org.springframework.context .ApplicationContextException

NtoZ·2023년 8월 13일
0

PreProject

목록 보기
2/12

문제 상황

  • 재부팅 후 빌드하려고 봤더니 갑자기 아래와 같은 예외가 출력되었다.
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to create tempDir. java.io.tmpdir is set to C:\WINDOWS\
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.29.jar:5.3.29]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.14.jar:2.7.14]
	at com.codestates.stackoverflowbe.StackoverflowBeApplication.main(StackoverflowBeApplication.java:12) ~[main/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to create tempDir. java.io.tmpdir is set to C:\WINDOWS\
	at org.springframework.boot.web.server.AbstractConfigurableWebServerFactory.createTempDir(AbstractConfigurableWebServerFactory.java:208) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:195) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:184) ~[spring-boot-2.7.14.jar:2.7.14]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.7.14.jar:2.7.14]
	... 8 common frames omitted
Caused by: java.nio.file.AccessDeniedException: C:\WINDOWS\tomcat.8080.8464614747414907246
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) ~[na:na]
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[na:na]
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[na:na]
	at java.base/sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:509) ~[na:na]
	at java.base/java.nio.file.Files.createDirectory(Files.java:690) ~[na:na]
	at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:135) ~[na:na]
	at java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:172) ~[na:na]
	at java.base/java.nio.file.Files.createTempDirectory(Files.java:1007) ~[na:na]
	at org.springframework.boot.web.server.AbstractConfigurableWebServerFactory.createTempDir(AbstractConfigurableWebServerFactory.java:202) ~[spring-boot-2.7.14.jar:2.7.14]
	... 11 common frames omitted
  • 알고 보니 인텔리제이에 등록해두었던 환경변수의 일부가 날아가서 실행이 되지 않았다.

    시스템 변수에 있는 환경변수까지 포함해서 빌드했더니 정상적으로 동작한다.
profile
9에서 0으로, 백엔드 개발블로그

0개의 댓글