๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ/JAVA

[JAVA] java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.error(Ljava/lang/String;Ljava/lang/Object;)V]

by ynzu๐Ÿค 2022. 3. 25.
๋ฐ˜์‘ํ˜•

 

๊ณตํ†ต ์‚ฌ์šฉ๋˜๋Š” ๊ธฐ๋Šฅ์„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๋งŒ๋“ค์—ˆ๋‹ค.
์ด ๊ณตํ†ต ๊ธฐ๋Šฅ์„ ๋ชจ์•„๋‘” ํ”„๋กœ์ ํŠธ์˜ pom.xml์—๋Š”  log4j-api.jar๋ฅผ ์„ ์–ธํ•˜์˜€๊ณ , ์ด๋ฅผ ์ด์šฉํ•˜์—ฌ log๋ฅผ ๋‚จ๊ฒผ๋‹ค.
ex) log.error("์—๋Ÿฌ ๋ฐœ์ƒ");, log.debug("์ฒ˜๋ฆฌ ์™„๋ฃŒ");
 
ํ•˜์ง€๋งŒ ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ์—์„œ ๊ณตํ†ต ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋‹ˆ ๋กœ๊ทธ๋ฅผ ๋‚จ๊ธฐ๋Š” ๋ถ€๋ถ„์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค.
Servlet.service() for servlet [appServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.error(Ljava/lang/String;Ljava/lang/Object;)V] with root cause
java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.error(Ljava/lang/String;Ljava/lang/Object;)V

 


์›์ธ์€ ๊ณตํ†ต ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ์ ํŠธ์˜ log4j-api.jar ๋ฒ„์ „์ด ๋‹ฌ๋ž๊ธฐ ๋•Œ๋ฌธ!

(๊ณตํ†ต ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” 2.17.1๋ฒ„์ „์„ ์‚ฌ์šฉ ์ค‘์ด์˜€๊ณ , ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ๋Š” 2.3.2๋ฅผ ์‚ฌ์šฉ ์ค‘์ด์˜€์Œ)

๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „์„ ๋งž์ถฐ์„œ ํ•ด๊ฒฐํ•˜์˜€๋‹ค.

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€