Bug 66020 - Log4j error message while creating HSSFWorkbook object
Summary: Log4j error message while creating HSSFWorkbook object
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 5.2.2-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-20 13:02 UTC by Navdeep
Modified: 2022-04-28 07:11 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Navdeep 2022-04-20 13:02:21 UTC
While creating an object of   HSSFWorkbook, getting the error message.

  HSSFWorkbook new_workbook1 = new HSSFWorkbook();


Error Message:

 "error": "Internal Server Error",
 "message": "org.apache.logging.log4j.Logger.atDebug()Lorg/apache/logging/log4j/LogBuilder;",
    "trace": "java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.atDebug()Lorg/apache/logging/log4j/LogBuilder;\r\n\tat org.apache.poi.hssf.model.InternalWorkbook.createWorkbook(InternalWorkbook.java:330)\r\n\tat org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:242)
Comment 1 PJ Fanning 2022-04-20 13:20:07 UTC
The log4j-api jar you have in your classpath does not match the one that poi needs. Or you have more than 1 log4j-api jar. Latest versions of POI (5.2.x) need log4j-api 2.17.x
Comment 2 Dominik Stadler 2022-04-28 07:11:22 UTC
Likely caused by an invalid classpath, thus closing this for now, please reopen with more information if you still think there is a problem in Apache POI here.