leerssej / google-refine

Automatically exported from code.google.com/p/google-refine
Other
0 stars 0 forks source link

ArrayIndexOutOfBoundsException when importing excel file #188

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Import Attached Excel Sheet

I get this error:

java.lang.ArrayIndexOutOfBoundsException: 0
    at org.apache.poi.poifs.storage.DocumentBlock.getDataInputBlock(DocumentBlock.java:162)
    at org.apache.poi.poifs.filesystem.POIFSDocument.getDataInputBlock(POIFSDocument.java:253)
    at org.apache.poi.poifs.filesystem.DocumentInputStream.getDataInputBlock(DocumentInputStream.java:117)
    at org.apache.poi.poifs.filesystem.DocumentInputStream.(DocumentInputStream.java:75)
    at org.apache.poi.poifs.filesystem.DirectoryNode.createDocumentInputStream(DirectoryNode.java:131)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:274)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:201)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:183)
    at com.google.refine.importers.ExcelImporter.read(ExcelImporter.java:76)
    at com.google.refine.commands.project.CreateProjectCommand.internalInvokeImporter(CreateProjectCommand.java:478)
    at com.google.refine.commands.project.CreateProjectCommand.load(CreateProjectCommand.java:341)
    at com.google.refine.commands.project.CreateProjectCommand.internalImportFile(CreateProjectCommand.java:327)
    at com.google.refine.commands.project.CreateProjectCommand.internalImport(CreateProjectCommand.java:169)
    at com.google.refine.commands.project.CreateProjectCommand.doPost(CreateProjectCommand.java:112)
    at com.google.refine.RefineServlet.service(RefineServlet.java:174)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
    at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Using Version 2.0 [r1836] on Windows

Original issue reported on code.google.com by HyderAla...@gmail.com on 11 Nov 2010 at 1:03

Attachments:

GoogleCodeExporter commented 8 years ago
I can reproduce.  I suspect the bug might be in POI rather than in Refine, but 
I'll investigate.

Original comment by iainsproat on 11 Nov 2010 at 1:30

GoogleCodeExporter commented 8 years ago
According to POI bug report 48261, 
https://issues.apache.org/bugzilla/show_bug.cgi?id=48261 , the issue is likely 
a corrupted Excel file (probably caused by the file being created from a 
non-Excel application).  Their advice is to open the file in Excel and resave.

I've done this and can confirm that it works in Refine.  The file I used is 
attached.

Original comment by iainsproat on 11 Nov 2010 at 1:54

Attachments:

GoogleCodeExporter commented 8 years ago
I can confirm this as well. No fix is necessary, but it would be nice to inform 
users of the solution when this error is encountered.

Original comment by HyderAla...@gmail.com on 11 Nov 2010 at 1:58

GoogleCodeExporter commented 8 years ago
Good call.  I've added additional error dialog and committed it to the trunk, 
r1858

Original comment by iainsproat on 11 Nov 2010 at 2:27

GoogleCodeExporter commented 8 years ago
org.apache.poi.hssf.usermodel.HSSFWorkbook .I am using this API i am getting 
out of memory error while just opening the file.I get out of memory error.The 
file is 25 mb.How can i resolve this?

Original comment by hiren.t....@gmail.com on 18 Dec 2010 at 8:11

GoogleCodeExporter commented 8 years ago
If you are having this problem with Google Refine, please open a new bug report 
with the details of your problem.

If your problem is with some other use of Apache POI, please contact the POI 
team.  There's no one here who can help.

Original comment by tfmorris on 18 Dec 2010 at 8:42

GoogleCodeExporter commented 8 years ago

Original comment by tfmorris on 18 Sep 2012 at 3:01