poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56745] New: POIXMLException raised if workbook opened with XSSFWorkbook(String) constructor
Date Fri, 18 Jul 2014 23:53:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56745

            Bug ID: 56745
           Summary: POIXMLException raised if workbook opened with
                    XSSFWorkbook(String) constructor
           Product: POI
           Version: 3.10
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: iceardor@gmail.com

I am getting the following exception when trying to write my workbook out to a
file:

org.apache.poi.POIXMLException: java.io.IOException: Can't obtain the input
stream from /docProps/app.xml

Here's the code to reproduce the problem (my best translation from Jython to
Java)
// open workbook
    String filename = "C:\\path\\to\\file.xlsx";
    File file = new File(filename);
    Workbook wb = new XSSFWorkbook(filename);

    // save the workbook to disk
    FileOutputStream out = new FileOutputStream(file);
    wb.write(out);
    out.close();

The error occurs while writing the file (wb.write(out)).

Additionally, after XSSFWorkbook(filename) has run, if I try to rename the file
in Windows Explorer, I get a "File In Use: The application can't be completed
because the file is open in Java(TM) Platform SE binary". I'm not sure if this
is a related problem.

The following code does not have this problem:
    // open workbook
    FileInputStream in = new FileInputStream(file);
    wb = WorkbookFactory.create(file);
    in.close();

    // save the workbook to disk
    FileOutputStream out = new FileOutputStream(file);
    wb.write(out);
    out.close();

Related: bug #56537. Does the fix for 56537 also fix this bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message