I am trying to run the below example code to read an xls, but get the error 
below. NOTE the ArrayList departments = new ArrayList();  it gave me a Type 
Mismatch error if I used the original example as shown: List departments = new 
ArrayList(); :
          InputStream inputXML = new 
BufferedInputStream(EWSDemo.class.getResourceAsStream("./config.xml"));         
 XLSReader mainReader = ReaderBuilder.buildFromXML( inputXML );          
InputStream inputXLS = new 
BufferedInputStream(EWSDemo.class.getResourceAsStream("./departmentdata.xls")); 
         Department department = new Department();          Department 
hrDepartment = new Department();          ArrayList departments = new 
ArrayList();          Map beans = new HashMap();          
beans.put("department", department);          beans.put("hrDepartment", 
hrDepartment);          beans.put("departments", departments);          
XLSReadStatus readStatus = mainReader.read( inputXLS, beans);
Exception in thread "main" java.io.IOException: Stream closed   at 
java.io.BufferedInputStream.getInIfOpen(Unknown Source)      at 
java.io.BufferedInputStream.fill(Unknown Source)     at 
java.io.BufferedInputStream.read1(Unknown Source)    at 
java.io.BufferedInputStream.read(Unknown Source)     at 
org.apache.poi.util.IOUtils.readFully(IOUtils.java:92)       at 
org.apache.poi.util.IOUtils.readFully(IOUtils.java:77)       at 
org.apache.poi.poifs.filesystem.POIFSFileSystem.hasPOIFSHeader(POIFSFileSystem.java:207)
     at 
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)  at 
net.sf.jxls.reader.XLSReaderImpl.read(XLSReaderImpl.java:32) at 
demo.EWSDemo.main(EWSDemo.java:77)

                                          
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxls-user

Reply via email to