IllegalAccessException in PrjFileReader on close

Description

When reading a shapefile with Geotools' ContentFeatureSource the below exception occurs. This component does not seem to respect the Java Module exports of the NIO package.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.geotools.resources.NIOUtilities (file:/C:/Users/Janek/.m2/repository/org/geotools/gt-metadata/20.2/gt-metadata-20.2.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.geotools.resources.NIOUtilities
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
Juli 04, 2019 11:02:38 VORM. org.geotools.resources.NIOUtilities log
SEVERE: Error attempting to close a mapped byte buffer : java.nio.DirectByteBuffer
JVM : 11.0.1 Oracle Corporation
java.lang.IllegalAccessException: class org.geotools.resources.NIOUtilities$1 cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module @7d0b7e3c
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
at java.base/java.lang.reflect.Method.invoke(Method.java:558)
at org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:218)
at org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:206)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.geotools.resources.NIOUtilities.clean(NIOUtilities.java:205)
at org.geotools.data.PrjFileReader.close(PrjFileReader.java:161)
at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:90)
at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:62)
at org.geotools.data.shapefile.ShapefileSetManager.openPrjReader(ShapefileSetManager.java:101)
at org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:523)
at org.geotools.data.shapefile.ShapefileFeatureSource.buildFeatureType(ShapefileFeatureSource.java:479)
at org.geotools.data.shapefile.ShapefileFeatureStore.buildFeatureType(ShapefileFeatureStore.java:137)
at org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:328)
at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:297)
at org.geotools.data.store.ContentFeatureCollection.<init>(ContentFeatureCollection.java:70)
at org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:546)
at org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:106)
at org.matsim.core.utils.gis.ShapeFileReader.getAllFeatures(ShapeFileReader.java:77)
at org.matsim.nemo.runners.smartCity.RunRuhrgebietSmartCityScenario.run(RunRuhrgebietSmartCityScenario.java:115)
at org.matsim.nemo.runners.smartCity.RunRuhrgebietSmartCityScenario.main(RunRuhrgebietSmartCityScenario.java:75)

Environment

None

Status

Assignee

Unassigned

Reporter

Janek Laudan

Triage

None

Affects versions

Priority

Medium
Configure