2

So I got a request converting xls to xlsx. After a few hours of researching all sites and solutions I managed to adapt some code i found on various site... Now I am stuck with a java.lang.NoClassDefFoundError: org/apache/log4j/Logger

here is a list all my libs i am using to get this working so far, I had to add a few libs just to get this far and now i am stuck.

dropbox-core-sdk-1.7.7, itextpdf-5.3.0, jackson-core-2.2.4, PDFBox-0.7.3, poi-3.10-FINAL-20140208, poi-ooxml-3.5-beta5, poi-ooxml-schemas-3.10-beta1, rs2xml, slf4j-api-1.7.5, sqlite, sqlite-jdbc-3.8.7, xmlbeans 

Below is my code where i call he class

private void exportRepBtnActionPerformed(java.awt.event.ActionEvent evt) { connect(); exportRepairReport(); // This is where I am trying to convert the xls file convertExcelFiles.convertWorkbookHSSFToXSSF(workbook); // int selectedOption = JOptionPane.showConfirmDialog(null, "Generate Comprehensive Report?", "OPTIONAL", JOptionPane.YES_NO_OPTION); if (selectedOption == JOptionPane.YES_OPTION) { exportRawRepairs(); } } 

Hers is the class where things go south.

public static XSSFWorkbook convertWorkbookHSSFToXSSF(HSSFWorkbook source) { XSSFWorkbook retVal = new XSSFWorkbook(); for (int i = 0; i < source.getNumberOfSheets(); i++) { XSSFSheet xssfSheet = retVal.createSheet(); HSSFSheet hssfsheet = source.getSheetAt(i); copySheets(hssfsheet, xssfSheet); } return retVal; } 

Any help will be appreciated, let me know if you need more info.

Thanks in advance.

3
  • Add this jar .mvnrepository.com/artifact/log4j/log4j/1.2.17 Commented Jul 27, 2016 at 7:32
  • @Unknown that's the old artifact, last updated 2012. here is the new one. Commented Jul 27, 2016 at 7:34
  • Thanx for the help i wasnt really paying attention to the jar... i appreciate the help Commented Jul 27, 2016 at 7:45

2 Answers 2

4

You have to add the log4j<version>.jar to your classpath.

Sign up to request clarification or add additional context in comments.

Comments

1

You should add log4j.jar to your classpath

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.