https://issues.apache.org/bugzilla/show_bug.cgi?id=48493

           Summary: Get NullPointerException in
                    org.apache.xmlbeans.impl.store.Xobj.array_setter when
                    creating Excel spreadsheet
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=24802)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24802)
The java class ExcelObj.java that is referenced in the bug text

I have a web application that uses our ExcelObj.java (code attached) to write
an Excel file.  When it reaches the line
    wb.write(fOut);
it stops with this exception:
java.lang.NullPointerException
    at org.apache.xmlbeans.impl.store.Xobj.array_setter(Xobj.java:2401)
    at
org.apache.xmlbeans.impl.values.XmlComplexContentImpl.arraySetterHelper(XmlComplexContentImpl.java:1055)
    at
org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTWorksheetImpl.setColsArray(Unknown
Source)
    at org.apache.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:2297)
    at org.apache.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:2287)
    at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:177)
    at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:181)
    at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:214)
    at gov.bls.dbes.sled.util.ExcelObj.close(ExcelObj.java:110)
    at gov.bls.dbes.sled.util.ExcelWriter.writeExcelFile(ExcelWriter.java:296)
    at gov.bls.dbes.sled.util.ExcelWriter.writeExcelFile(ExcelWriter.java:352)
    at
gov.bls.dbes.sled.action.ProcessNewExcelAction.outputExcel(ProcessNewExcelAction.java:231)
    at
gov.bls.dbes.sled.action.ProcessNewExcelAction.writeOutExcel(ProcessNewExcelAction.java:125)
    at
gov.bls.dbes.sled.action.ProcessNewExcelAction.execute(ProcessNewExcelAction.java:80)
    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:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3241)
    at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2010)
    at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
    at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

HOWEVER when I alter the single line
           wb = new XSSFWorkbook();
to be
           wb = new HSSFFWorkbook();
(in other words, to use HSSF rather than XSSF) the execution finishes normally.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to