I'm new to POI and try to create a POIFSFileSystem resp. a HSSFWorkbook from
a ByteArrayInputStream. The reason for not using a xls File is, that the
user could upload a valid xls file through a servlet in an application server,
which passes the content of this uploaded file in a byte[] to the ExcelFile
Parser. If I run this application I get the following exception:
java.io.IOException: Invalid header signature; read 3255307777713450285,
expected -2226271756974174256
at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:124)
at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:120)
at de.d2vodafone.apps.vpn.ExcelParser.<init>(ExcelParser.java:78)
at
de.d2vodafone.apps.vpn.SmartUpload.processXlsFile(SmartUpload.java:29)
at
de.vodafone._jsp._upload._DoUpload._jspService(_DoUpload.java:122)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:106)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:507)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:481)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
If I save the uploaded file temporary in the application server's file
system and read the file through a FileInputStream, everything works ok.
Where is my mistake ??
TIA
Juergen
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net