Bug 56601

Summary: The requested operation cannot be performed on a file with a user-mapped section open
Product: POI Reporter: Jamie Singer <jamie.singer>
Component: XSSFAssignee: POI Developers List <dev>
Severity: normal CC: jamie.singer
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: logical flow to recreate

Description Jamie Singer 2014-06-06 19:15:12 UTC
IOException intermittently thrown when repeatedly writing cells, cell.setCellValue( sValue ), or creating new .xlsx.

The specific exception type is FileNotFoundException with a message of "The requested operation cannot be performed on a file with a user-mapped section open" which is bizarre because the file does exist, is not open elsewhere, and the code works most of the time.
Comment 1 Jamie Singer 2014-06-06 19:29:18 UTC
Created attachment 31693 [details]
logical flow to recreate

The code attached has wrapped functions that are not included, but the implementations simply wrap the POI calls with exception handling. The attachment demonstrates the logical flow.

Sometimes the test runs 1000s of time without problem until I kill it. Other times it blows up quickly with the exception in bug report.
Comment 2 Nick Burch 2014-06-09 16:42:49 UTC
Does it always trigger in the same place in the code, or does it differ? A stacktrace might help, especially if it's the same each time
Comment 3 Dominik Stadler 2014-07-02 14:37:23 UTC
Also which operating system is this on? We had cases where Windows reported such types of errors sometimes, so this may be the same thing...
Comment 4 Jamie Singer 2014-07-02 15:08:51 UTC
Windows 8 Pro with Microsoft Office Professional Plus 2010
Comment 5 Dominik Stadler 2015-09-13 20:11:57 UTC
Without a stacktrace and a clear reproducing unit-test this is very hard to work on. Intermittent exceptions often hint at multi-threading issues or other problems that are only appearing on single machines, not others. 

The sample code does not perform any suspicious thing and similar things run well on many machines without any such intermittent exceptions.

Therefore I don't think we can find out more with the amount of information provided right now and thus need to close it WORKSFORME for now, please reopen the bug if you can provide more information here, especially a self-sufficient piece of code without any "wrappers" and some stacktraces of the exceptions could give some hints about the problem.