Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
I get this exception:
12:42:28.888 [ org.mortbay.log] /command/core/importing-controller (59ms)
org.marc4j.MarcException: unable to parse record length
at org.marc4j.MarcPermissiveStreamReader.parseRecordLength(MarcPermissiveStreamReader.java:1214)
at org.marc4j.MarcPermissiveStreamReader.next(MarcPermissiveStreamReader.java:270)
at com.google.refine.importers.MarcImporter.createParserUIInitializationData(MarcImporter.java:77)
at com.google.refine.importing.DefaultImportingController.doInitializeParserUI(DefaultImportingController.java:230)
at com.google.refine.importing.DefaultImportingController.doPost(DefaultImportingController.java:91)
at com.google.refine.commands.importing.ImportingControllerCommand.doPost(ImportingControllerCommand.java:62)
at com.google.refine.RefineServlet.service(RefineServlet.java:178)
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.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
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.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "<!DOC"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.marc4j.MarcPermissiveStreamReader.parseRecordLength(MarcPermissiveStreamReader.java:1210)
... 28 more
12:42:33.178 [ refine] POST /command/core/importing-controller (4290ms)
12:42:33.215 [ open office] Error reading ODF spreadsheet (37ms)
java.lang.IllegalArgumentException: org.odftoolkit.odfdom.pkg.OdfValidationException; The ODF package shall be a ZIP file!
at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:335)
at org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:324)
at org.odftoolkit.odfdom.pkg.OdfPackage.<init>(OdfPackage.java:220)
at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:275)
at org.odftoolkit.odfdom.doc.OdfDocument.loadDocument(OdfDocument.java:219)
at com.google.refine.importers.OdsImporter.createParserUIInitializationData(OdsImporter.java:90)
at com.google.refine.importing.DefaultImportingController.doInitializeParserUI(DefaultImportingController.java:230)
at com.google.refine.importing.DefaultImportingController.doPost(DefaultImportingController.java:91)
at com.google.refine.commands.importing.ImportingControllerCommand.doPost(ImportingControllerCommand.java:62)
at com.google.refine.RefineServlet.service(RefineServlet.java:178)
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.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
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.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.odftoolkit.odfdom.pkg.OdfValidationException; The ODF package shall be a ZIP file!
at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:331)
... 31 more
Desktop (please complete the following information):
OpenRefine (please complete the following information):
Also a huge exception if you click on "RDF/XML files" with this URL.
In general yes, importers will throw exceptions if used with the incorrect file types. I guess there should be a clean way for an importer to notify the user that the format is incorrect. So this is mostly a UI issue.
When I tried to reproduce the error now (using the link provided), the server does throw an alert message that explains the error or tells the user to check the format of the file, and the Update Preview gets terminated once okay is clicked. JSON is the only format for which there is no error message, either sent to the user or the console.
@lisa761 FYI, we don't want users to have to rely on looking at the console to explain things (that is reserved for debugging things when we ask them to). We always want to make it easier for them by showing errors or explaining things in our UI. But you probably guessed this already.
@thadguidry Of course, I was just cross checking if the JSON format is the only one that needs debugging, considering that the other formats do explain the error to the user (to an extent).
Most helpful comment
@lisa761 FYI, we don't want users to have to rely on looking at the console to explain things (that is reserved for debugging things when we ask them to). We always want to make it easier for them by showing errors or explaining things in our UI. But you probably guessed this already.