Bug 62588 - Null pointer exception while debugging but same code work and provide me correct output when i ran it normal way
Summary: Null pointer exception while debugging but same code work and provide me corr...
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 3.17-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-31 14:52 UTC by Praveen
Modified: 2018-12-21 07:26 UTC (History)
0 users



Attachments
Attached the exception for the above code mentioned in the description. (48.40 KB, image/png)
2018-07-31 14:52 UTC, Praveen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Praveen 2018-07-31 14:52:03 UTC
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.
Comment 1 Dominik Stadler 2018-12-21 07:26:51 UTC
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.