Bug 58090 - Issue with XLSX parsing
Summary: Issue with XLSX parsing
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: Other other
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-01 11:19 UTC by yanamala1
Modified: 2015-07-07 20:29 UTC (History)
0 users



Attachments
Trying to parse the attached XLSX file (12.06 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-07-01 11:19 UTC, yanamala1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yanamala1 2015-07-01 11:19:06 UTC
Created attachment 32871 [details]
Trying to parse the attached XLSX file

Running the standalone application to process the email attachments ( XLS/XLSX/Word) in multi threaded environment. Following error is thrown while parsing the XLSX file using the following piece of code. PArsing comes to an halt and do not allow to process other XLSX files. It works only after the application restart. Appreciate if you could provide a solution for this at the earliest.( Attached the XLSX file )

 XSSFWorkbook workBook = new XSSFWorkbook(new FileInputStream(inputFile.getPath()));
    try{
     XSSFFormulaEvaluator.evaluateAllFormulaCells(workBook);
    }catch(RuntimeException e){
     LOG.debug("Exception occurred while evealating formulas");
    }
    sheetsNum=workBook.getNumberOfSheets();
    return sheetsNum;



org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
        at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:204)
        at com.highradius.caa.agents.DynamicRemittanceExcelAgent.getNumberOfSheets(DynamicRemittanceExcelAgent.java:427)
        at com.highradius.caa.agents.DynamicRemittanceExcelAgent.parseRemittance(DynamicRemittanceExcelAgent.java:156)
        at com.highradius.caa.syndication.framework.EmailAttachmentsParserAgent.run(EmailAttachmentsParserAgent.java:230)
        at com.scraper.CashAppAgentProcessorAction.run(CashAppAgentProcessorAction.java:136)
        at com.scraper.ScheduledAgentLauncher.immediatelyLaunchScheduledAgent(ScheduledAgentLauncher.java:266)
        at com.scraper.WrapperAgentAction.run(WrapperAgentAction.java:172)
        at sun.reflect.GeneratedMethodAccessor2565.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
        at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
        at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
        at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:107)
        at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:56)
        at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:167)
        at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:662)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:269)
        at org.apache.poi.util.PackageHelper.open(PackageHelper.java:39)
Comment 1 Nick Burch 2015-07-01 11:35:26 UTC
3.9 is a little old these days, any chance you could re-test with a more modern version, eg 3.12 final?
Comment 2 Dominik Stadler 2015-07-07 20:29:56 UTC
Tried this with latest POI 3.12 and opening the file worked fine there, please reopen with some more information if you still see this problem with a more up-to-date version of POI.