read excel file(which is in classpath ) via apache poi
问题 I am trying to read (using apache poi) .xlsx file which is not in file system but in classpath. I am using maven - so it is in resources folder. my code is - InputStream resourceAsStream = MyReader.class.getClassLoader().getResourceAsStream("test.xlsx"); Workbook wb = new XSSFWorkbook(resourceAsStream); I am getting this exception. Caused by: java.lang.IllegalArgumentException: MALFORMED at java.util.zip.ZipCoder.toString(ZipCoder.java:58) ~[?:1.7.0_51] at java.util.zip.ZipInputStream.readLOC