Hi ,
We are using the following code to open and read a excel file. this code has been working for a long time on a linux server. recently we have changed our build process to deploy using UCD, UCD seems to inject additional the environment variables in to our JVM application.
Issue is following code “new Workbook(excelFileStream)” stops responding and execution is hang in this line and JVM never responds to any of our excel processing request. want to understand what could be causing this issue. If i start the same code base manually everything just works fine.
inputfilestream could be sometime referring to the template excel file from one of the application jar file. sometime it could refer to the temporary file that user uploads. let me know if you need any additional details. this is one of the critical functionality with out which we are struck with the old build process.
Linux : x86_64 x86_64 x86_64 GNU/Linux
private void readExcel() {
try {
if (file != null) {
FileFormatInfo fileFormat = FileFormatUtil.detectFileFormat(file.getAbsolutePath());
if (fileFormat.getFileFormatType() == FileFormatType.EXCEL_95) {
throw new AsposeException("This is Excel 95 format file which is not supported. please use Excel 97 and higher formats.");
}
passwordProtected = fileFormat.isEncrypted();
String detectedExtension = FileFormatUtil.loadFormatToExtension(fileFormat.getLoadFormat());
if (detectedExtension != null) {
this.extension = detectedExtension;
}
}
workbook = new Workbook(excelFileStream);
//Set the Formula Calculation Mode to AUTOMATIC.
workbook.getSettings().setCalcMode(CalcModeType.AUTOMATIC);
} catch (CellsException e) {
throw new AsposeException("File format not supported, please use Excel 97 and higher formats.", e);
} catch (Exception e) {
LOGGER.debug(e.getMessage());
throw new AsposeException("Error reading excel file", e);
}
}