Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An illegal reflective access operation has occurred Apache POI

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
like image 241
tobiasbriones Avatar asked Apr 28 '18 01:04

tobiasbriones


2 Answers

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>
like image 91
Baljeet Avatar answered Nov 02 '22 23:11

Baljeet


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

like image 32
guoqing xu Avatar answered Nov 02 '22 23:11

guoqing xu