I'm attempting to get our system to read not only xls but xlsx files and have
it reading the xlsx files fine, however, once they've been touched by the
system the files get locked by JRun until the service is restarted.
Effectively I'm just creating a workbook object, then reading from it.
Here's some code:
LOCAL.FileInputStream = CreateObject( "java", "java.io.FileInputStream"
).Init( ARGUMENTS.FilePath );
LOCAL.WorkBook = CreateObject(
"java",
"org.apache.poi.xssf.usermodel.XSSFWorkbook"
).Init(
ARGUMENTS.FilePath
);
LOCAL.Sheets = ReadExcelSheet(
LOCAL.WorkBook,
ARGUMENTS.SheetIndex,
ARGUMENTS.HasHeaderRow
);
LOCAL.FileInputStream.Close();
So, once this runs I'm no longer able to modify the xlsx document. The
first thing that I notice is that I'm not creating the workbook with the
fileInputStream variable. When I try to use it, as opposed to the filepath
variable, it throws an error so the fileInputStream open and close doesn't
actually do anything. I removed both and it still worked, however JRun
still locks the file. What do I need to do to close the stream or whatever
it is that's locking the document
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/XSSF-JRun-locking-document-tp4870023p4870023.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]