Re: XSSFEvaluationWorkbook.getSheet can throw ArrayIndexOutOfBoundsException
Andreas Reichel <[email protected]> Sun, 31 Oct 2021 00:29:58 +0700
| Newsgroups | gmane.comp.jakarta.poi.user |
|---|---|
| Message-ID | <ef7a61954d0051c645fece0cd0fdb2c0d01e81a8.camel@manticore-projects.com> |
Greetings. On Sat, 2021-10-30 at 18:03 +0200, Dominik Stadler wrote: > If you use multi-threading in your big application, Nope, not within this particular Spreadsheet builder. >  you have to ensure that > a single Workbook is never used in multiple threads at the same time. Yes, am fully aware of that. > I have prepared a small change which avoid cases where sheets are > added > while FormulaEvaluator is in use. Certainly good, but I still maintain my point, that I have added all the sheets first before I evaluated anything. Although it is on me to trigger this problem reliably. I have also tried what happens, when a referenced sheet indeed does not exist. But this throws a different and precise Sheet Missing exception and is different from my observation. Will keep experimenting. > So as far as I see your best bet for now is to check for multi- > threaded > access and maybe use "clearAllCachedResultValues()" before evaluating > formulas. I need the evaluation for Column Autosizing only. So simple wrapping the call into a Try/Catch block works good enough for me. Have a great weekend and thanks for your help and support! Andreas