In addition to my above question, I've tried with geotools version 15-SNAPSHOT. And it works correctly. But I believe 15-SNAPSHOT means, it's not a release version. I'm sorry if I'm wrong. Extremely new here.
On Thu, Apr 7, 2016 at 8:33 AM, Thilina Yapa Bandara <[email protected]> wrote: > Hello all, > > I'm trying out SelectionLab in this link > <http://docs.geotools.org/latest/userguide/tutorial/map/style.html>. > Source file here > <https://github.com/geotools/geotools/blob/master/docs/src/main/java/org/geotools/tutorial/style/SelectionLab.java> > . > > But I get a null pointer exception at line 216 (selectedFeatures. > features();) > > The shapefile I'm using is this > <http://www.naturalearthdata.com/downloads/10m-cultural-vectors/airports/> > . > > Am I doing anything wrong? > > Following is the stack trace. > > Mouse click at: DirectPosition2D[-22.846079635654064, 63.50141573209309] > java.lang.NullPointerException > at > org.geotools.data.shapefile.ShapefileFeatureSource.getReaderInternal(ShapefileFeatureSource.java:336) > at > org.geotools.data.shapefile.ShapefileFeatureStore.getReaderInternal(ShapefileFeatureStore.java:126) > at > org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:634) > at > org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:173) > at org.geotools.gui2.testMain.selectFeatures(testMain.java:222) > at org.geotools.gui2.testMain$1$1.onMouseClicked(testMain.java:166) > at > org.geotools.swing.event.DefaultMapMouseEventDispatcher.mouseClicked(DefaultMapMouseEventDispatcher.java:99) > at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270) > at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:269) > at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:269) > at java.awt.Component.processMouseEvent(Component.java:6528) > at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) > at java.awt.Component.processEvent(Component.java:6290) > at java.awt.Container.processEvent(Container.java:2234) > at java.awt.Component.dispatchEventImpl(Component.java:4881) > at java.awt.Container.dispatchEventImpl(Container.java:2292) > at java.awt.Component.dispatchEvent(Component.java:4703) > at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) > at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4542) > at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) > at java.awt.Container.dispatchEventImpl(Container.java:2278) > at java.awt.Window.dispatchEventImpl(Window.java:2750) > at java.awt.Component.dispatchEvent(Component.java:4703) > at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) > at java.awt.EventQueue.access$500(EventQueue.java:97) > at java.awt.EventQueue$3.run(EventQueue.java:709) > at java.awt.EventQueue$3.run(EventQueue.java:703) > at java.security.AccessController.doPrivileged(Native Method) > at > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) > at > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) > at java.awt.EventQueue$4.run(EventQueue.java:731) > at java.awt.EventQueue$4.run(EventQueue.java:729) > at java.security.AccessController.doPrivileged(Native Method) > at > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) > at > java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) > at > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) > at > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) > > -- > regards, > > *Thilina Yapa Bandara* > -- regards, *Thilina Yapa Bandara* (*ආයුබෝවන් *- May All Beings Live Long)
------------------------------------------------------------------------------
_______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
