Exception in thread log4j.LogManager

When I Execute this program, a line comes with an warn message. (Workbook book = new XSSFWorkbook(excel);)

I will attach the Logs and code below :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
    at org.apache.poi.ooxml.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:56)
    at poi.DataDrivenPOI.excel(DataDrivenPOI.java:17)
    at poi.DataDrivenPOI.main(DataDrivenPOI.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
    ... 3 more

I need that Error to be resolved as it is not allowing the program to run.

First it started with some other error message :

java.lang.ClassNotFoundException: org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream

commons io fixed this issues

Post that i got this error

  • 2

    How are you managing your dependencies? Maven or Gradle? Have you tried adding log4j2 dependencies?

    – 




Leave a Comment