You are trying to use java 17, GeoTools prefers java 11 currently.

Ian

On Mon, 7 Nov 2022, 11:51 , <paul.m...@lfv.se> wrote:

> Hi,
>
> I'm trying to do read (import) a Shape file, in the end it is imported to
> my PostreSQL database but I get this exception when trying to use:
>
>
>
>     FeatureCollection<SimpleFeatureType, SimpleFeature> featSrcCollection
> = featSource.getFeatures();
>
>
>
> and I also tried (with the same result):
>
>
>
>     SimpleFeatureCollection featSrcCollection =
> (SimpleFeatureCollection)featSource.getFeatures();
>
>
>
> The exception I get is:
>
> SEVERE: Error attempting to close a mapped byte buffer :
> java.nio.DirectByteBuffer
>
> JVM : 17.0.4.1 Eclipse Adoptium
>
> java.lang.reflect.InaccessibleObjectException: Unable to make public
> jdk.internal.ref.Cleaner java.nio.DirectByteBuffer.cleaner() accessible:
> module java.base does not "opens java.nio" to unnamed module @3e3f6a88
>
>                 at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
>
>                 at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
>
>                 at
> java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
>
>                 at
> java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
>
>                 at
> org.geotools.resources.NIOUtilities.getCleanerMethod(NIOUtilities.java:238)
>
>                 at
> org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:210)
>
>                 at
> org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:206)
>
>                 at
> java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
>
>                 at
> org.geotools.resources.NIOUtilities.clean(NIOUtilities.java:205)
>
>                 at
> org.geotools.resources.NIOUtilities.clean(NIOUtilities.java:184)
>
>                 at
> org.geotools.data.shapefile.dbf.DbaseFileHeader.readHeader(DbaseFileHeader.java:639)
>
>                 at
> org.geotools.data.shapefile.dbf.DbaseFileReader.init(DbaseFileReader.java:205)
>
>                 at
> org.geotools.data.shapefile.dbf.DbaseFileReader.<init>(DbaseFileReader.java:144)
>
>                 at
> org.geotools.data.shapefile.ShapefileSetManager.openDbfReader(ShapefileSetManager.java:75)
>
>                 at
> org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:521)
>
>                 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.geotools.jdbcconnection.data.importShape.importShapeFile(importShape.java:381)
>
>
>
> Has anyone solved this problem?
>
> Kind regards,
>
> Paul Malm
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to