I have the following code in the controller in my web app to open an excel template that I use to generate reports from. Locally, the code below works fine to open the file as a BufferedInputStream and load it with data and then send it to the web client. However, when my web app is released as a war file, instead of getting a BufferedInputStream back I am getting a weblogic.utils.zip.SafeZipFileInputStream back and am unable to covert this into an XSSFWorkbook. The excel file is definitely in the war file and I can see that it is returning something to me, it just does not appear to be the excel file I was expecting. The error that I am receiving when I run from the war file is the following: java.util.zip.ZipException: invalid distance too far back
Any thoughts what I am doing wrong here? Thanks in advance.
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("/com/mycomp/myapp/exceltemplates/MyExcelTemplate.xlsx");
logger.info("XXXXXXXXXXXXXXXXXXXXXXX InputStream is=" + is);