I’m using Clojure to do the basic tutorial on displaying a shape file on 
OpenJDK 11:

  (-> (doto (DefaultMapContext.)
        (.setTitle "Quickstart")
        (.addLayer (-> (io/resource "geotools/maps/countries.shp")
                       (FileDataStoreFinder/getDataStore)
                       (.getFeatureSource))
                   nil))
      (JMapFrame/showMap))

However, the call to JMapFrame.showMap gives a strange error that I’m not too 
sure what the cause is:

tools.map.FeatureLayer[, VISIBLE]
java.lang.NoSuchFieldError: JAVA_9
        at org.geotools.util.NIOUtilities.clean(NIOUtilities.java:207)
        at org.geotools.util.NIOUtilities.clean(NIOUtilities.java:185)
        at 
org.geotools.data.shapefile.dbf.DbaseFileReader.close(DbaseFileReader.java:300)
        at 
org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:586)
        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:327)
        at 
org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:296)
        at 
org.geotools.data.store.ContentFeatureSource.resolvePropertyNames(ContentFeatureSource.java:1101)
        at 
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:362)
        at 
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:351)
        at org.geotools.map.FeatureLayer.getBounds(FeatureLayer.java:188)
        at org.geotools.map.MapContent.getMaxBounds(MapContent.java:602)
        at 
org.geotools.swing.AbstractMapPane.setFullExtent(AbstractMapPane.java:890)
        at 
org.geotools.swing.AbstractMapPane.doSetMapContent(AbstractMapPane.java:540)
        at org.geotools.swing.AbstractMapPane.<init>(AbstractMapPane.java:197)
        at org.geotools.swing.JMapPane.<init>(JMapPane.java:71)
        at org.geotools.swing.JMapPane.<init>(JMapPane.java:60)
        at org.geotools.swing.JMapFrame.<init>(JMapFrame.java:178)
        at org.geotools.swing.JMapFrame.doShowMap(JMapFrame.java:150)
        at org.geotools.swing.JMapFrame.access$000(JMapFrame.java:70)
        at org.geotools.swing.JMapFrame$1.run(JMapFrame.java:143)
        at 
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at 
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at 
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at 
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

It’d be great to figure out what is wrong.
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to