Summary: | Null pointer exception while debugging but same code work and provide me correct output when i ran it normal way | ||
---|---|---|---|
Product: | POI | Reporter: | Praveen <praveenhudgi> |
Component: | SXSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 3.17-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Attached the exception for the above code mentioned in the description. |
The exception seems to happen deeply inside JVM code while class-loading and is not related to POI itself. Also seems to only happen when debugging in local IDE, so not easy to reproduce. Therefore I am not sure how we can help/investigate her. If it works when run without IDE debugging, it seems to be caused by some glitch in your IDE and not in code in POI. Thus I am closing this with WORKSFORME unless there is some more indication of a problem directly in Apache POI code here. |
Created attachment 36061 [details] Attached the exception for the above code mentioned in the description. Null pointer exception is thrown ,When i am trying to read data from external source Excel. here is my code to read data from excel (.xlsx) public class ExcelReader { public static void main(String[] args) throws Exception { String path ="C:\\Users\\hudgipr\\Desktop\\ConfigData.xlsx"; FileInputStream fis = new FileInputStream(path); Workbook wb = WorkbookFactory.create(fis); Sheet sh = wb.getSheet("Flipkart"); Row rw = sh.getRow(0); Cell cl =rw.getCell(0); System.out.println(cl.getStringCellValue()); } } problem is when i run it normal way it works fine and provide me correct output without throwing any exception,but when i debug same code i get an exception on the line code Workbook wb = WorkbookFactory.create(fis); Please find attachment for exception while debugging. Please help me i am blocked on this from 3 days and did not found any solution,not sure whats the issue.