Posts

Showing posts with the label Java Excel Export

Resolving Excel Export I/O Stream Error/Fatal Error Issue

Problem:     Fatal Application Error while exporting search results data into an excel sheet. Root Cause for the Issue is: The Root Cause of the issue is Because of using the global (Instance) variables instead of using the method variables inside the class for writing the data to the excel file. In Struts 1.1/1.2 the Action class behaves like singleton. There will be only one instance of the action for all the incoming requests. So whenever we try to build our logic using the instance variables (The variables which we are defining at the top of the class outside the method area) instead of local variables (or method variables), we will face data inconsistency issues. If we are using this kind of variables for IO operations then we will be ending with Stream errors (like the one we faced in one of our application recently). In the case of our (XYZ) application, there was a call to flushRows(100) function on