I have a requirement to convert csv file to excel (xlsx format). I am using WM 9.10 and have written a java service and used Apache poi framework for same. I am able to create xlsx file on local using test harness service but on server I get Null pointer exception. If I try to create xls file on server it gets created with no issue.
Below are the imports I have used:
If I use below code, it gives me null pointer exception only on server but works fine on local
Workbook workBook = new SXSSFWorkbook();
SXSSFSheet sheet = (SXSSFSheet) workBook.createSheet(“Sheet”);
but if I use
Workbook workBook = new HSSFWorkbook();
Sheet sheet = (SXSSFSheet) workBook.createSheet(“Sheet”);
then I don’t get any issue and file gets created on server as well as on local.
How to check if our filesystem supports xlsx format as I believe an issue with code would have been caught in local testing as well.