Getting Null pointer exception while trying to create xlsx file on unix

Hi All,

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:

import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;

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.

If you want help with this kind of problem, it would be useful to post a copy of your java service and the stack trace of the error.

I hope you managed to solve your problem and we are actively try to make sure you get timely response in the future, so please come back and share your issues with is.

regards
John.
Product Manager
Integration & Microservice Runtime

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.