Bug 59011 - while uploading xlsx file from the servlet path of tomcat i.e. the file is saved in the application itself. The file input stream was taken from the path file and was loaded. The exception occurred.
Summary: while uploading xlsx file from the servlet path of tomcat i.e. the file is sa...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.13-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-16 12:59 UTC by Rudrajit Basu
Modified: 2016-02-17 07:39 UTC (History)
0 users



Attachments
This file is saved in open office as xlsx file and was saved in the web application itself, where I got the inputstream to pass to apache poi xssfworkbook constructor. (15.14 KB, application/zip)
2016-02-16 12:59 UTC, Rudrajit Basu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rudrajit Basu 2016-02-16 12:59:08 UTC
Created attachment 33561 [details]
This file is saved in open office as xlsx file and was saved in the web application itself, where I got the inputstream to pass to apache poi xssfworkbook constructor.

while uploading xlsx file from the servlet path of tomcat i.e. the file is saved in the application itself. The file input stream was taken from the path file and was loaded. The exception occurred.

org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exception : this error should NEVER happen! Please raise a bug at https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI and attach a file that triggers it, thanks!
	at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.getContentType(ContentTypeManager.java:343)
	at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.removeContentType(ContentTypeManager.java:256)
	at org.apache.poi.openxml4j.opc.OPCPackage.removePart(OPCPackage.java:943)
	at org.apache.poi.openxml4j.opc.PackagePart.getOutputStream(PackagePart.java:522)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.commit(XSSFWorkbook.java:1678)
	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:341)
	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:206)
	at billing.monthlyTimeSheetReport.TimesheetReportAction.startProcessing(TimesheetReportAction.java:245)
	at billing.monthlyTimeSheetReport.TimesheetReportAction.execute(TimesheetReportAction.java:74)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at webprompt.application.RequestValidator.doFilter(RequestValidator.java:87)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:745)

The uploaded file is in the attachment. This file is saved in open office as xlsx file and was saved in the web application itself, where I got the inputstream to pass to apache poi xssfworkbook constructor.

Thanks in advance.
Comment 1 Rudrajit Basu 2016-02-17 06:34:54 UTC
I have made a mistake in reporting the issue ,the reason because of which the exception "org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exception : this error should NEVER happen! Please raise a bug at https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI and attach a file that triggers it, thanks!" is occurring when I am loading a filled xlsx file as Xssfworkbook and then I have edited on the same file and then when I am trying to write the outputstream from the Xssfworkbook instance I am getting this error.
Comment 2 Rudrajit Basu 2016-02-17 07:39:24 UTC
I was getting this exception as I had closed the XSSFWorkbook instance object and then I was trying to write the outputstream from the same instance.