발생 상황
Log4j2 라이브러리를 찾을 수 없다고 했다.
하지만 맨 처음 환경 세팅할 때 완벽하게 했지만, 소스는 정직하기 때문에 한번 더 확인해 봤다.
java.lang.IllegalStateException: Failed to load ApplicationContext
.....
.....
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'hikariConfig' defined in URL
[file:src/main/webapp/WEB-INF/root-context.xml]: Error setting property values;
nested exception is org.springframework.beans.PropertyBatchUpdateException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:
Property 'driverClassName' threw exception;
nested exception is java.lang.NoClassDefFoundError:
Unable to find Log4j2 as default logging library.
Please provide a logging library and configure a valid spyLogDelegator name
in the properties file.
해결 방식
maven에 Log4j-api 와 Log4j-core 메이븐을 추가해 주었다.
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0.1</version>
</dependency>
참고 블로그
https://jwj1699.tistory.com/14
log4jdbc-log4j2 적용중 오류
log4jdbc-log4j2 메이븐추가도했고 log4jdbc-log4j2.properties도 만들어주고 driverClassName과 url도 변경해주었는데 오류가난다... 로그는 다음과 같다java.lang.IllegalStateException: Failed to load ApplicationContext at org.sp
jwj1699.tistory.com
'오류 > Spring' 카테고리의 다른 글
Unauthorized 예외와 JWT 관련 예외 분리하기 (0) | 2024.03.11 |
---|---|
JWT 로그인시 401 에러 (0) | 2024.03.11 |
@Setter Autowired cannot be resolved to a type (0) | 2024.03.11 |
web.xml에서 cvc-id.3 (0) | 2024.03.11 |
there is '1' error in 'web-common_3_0.xsd'. (0) | 2024.03.11 |