9

I'm using Apache POI to work with excel files, as of Java 9 I get this message, according to this post JDK9: An illegal reflective access operation has occurred. org.python.core.PySystemState we should wait for the developer to fix the issue, but should I leave it like that in my new production version? I think it shouldn't be a problem if I skip the warning.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.poi.util.DocumentHelper (file:/T:/Workspace/Java/Sections%20Manager/libs/poi/poi-ooxml-3.17.jar) to method com.sun.org.apache.xerces.internal.util.SecurityManager.setEntityExpansionLimit(int)
WARNING: Please consider reporting this to the maintainers of org.apache.poi.util.DocumentHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
tobiasbriones
  • 221
  • 1
  • 2
  • 9
  • 3
    Just a go through about Java 9 support and also if you can use nightly builds - http://apache-poi.1045710.n5.nabble.com/support-for-Java-9-td5729928.html. Anyway whether or not proceeding with those warning is your decision and rest of us can just add our opinions based on how long and what purpose do you want to use such code in production. – Naman Apr 28 '18 at 03:20
  • 2
    If I were you then I would at least create a bug in the Apache POI issue tracker (assuming there isn't a bug already). – Alan Bateman Apr 28 '18 at 06:49
  • See https://bz.apache.org/bugzilla/show_bug.cgi?id=62151 and https://bz.apache.org/bugzilla/show_bug.cgi?id=61572. For Java 10 support there is additionally https://bz.apache.org/bugzilla/show_bug.cgi?id=62187 – centic Apr 30 '18 at 11:44

2 Answers2

6

Add the updated "poi-ooxml" dependency. It will resolve all the above warnings.

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>4.1.0</version>
</dependency>
Baljeet
  • 61
  • 1
  • 4
2

The error I encountered was : WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.poi.util.DocumentHelper (file:/D:/Libary/poi-3.12/poi-ooxml-3.12-20150511.jar) to method com.sun.org.apache.xerces.internal.util.SecurityManager.setEntityExpansionLimit(int) WARNING: Please consider reporting this to the maintainers of org.apache.poi.util.DocumentHelper WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

please use poi-3.6 or a later version,I use poi-3

guoqing xu
  • 21
  • 2