[geotk] Re: trouble with jai-next
Brigitte Charnomordic
bch at supagro.inra.fr
Thu Feb 10 07:28:04 EST 2011
Hello Johann,
here are your infos:
the full stacktrace of the error:
brigitte @ galatea : /mnt/lasb/GEOTK 10:03:36
$ java -cp ./bin/class:/home/brigitte/GEO/geotk-bundle-pending-3.16.jar
geo/TestShapeFile
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
org.geotoolkit.display.canvas.DefaultCanvasController2D.setVisibleArea(DefaultCanvasController2D.java:280)
at
org.geotoolkit.display2d.canvas.J2DCanvasVolatile$DelayedController.setVisibleArea(J2DCanvasVolatile.java:299)
at
org.geotoolkit.display2d.canvas.J2DCanvasVolatile.resize(J2DCanvasVolatile.java:103)
at
org.geotoolkit.display2d.canvas.SwingVolatileGeoComponent$1.componentResized(SwingVolatileGeoComponent.java:53)
at java.awt.Component.processComponentEvent(Component.java:6042)
at java.awt.Component.processEvent(Component.java:5996)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "Thread-6" java.lang.NullPointerException
at
org.geotoolkit.display2d.canvas.DefaultRenderingContext2D.getResolution(DefaultRenderingContext2D.java:549)
at
org.geotoolkit.display2d.container.statefull.StatefullFeatureLayerJ2D.updateCache(StatefullFeatureLayerJ2D.java:95)
at
org.geotoolkit.display2d.container.statefull.StatefullFeatureLayerJ2D.paintVectorLayer(StatefullFeatureLayerJ2D.java:144)
at
org.geotoolkit.display2d.container.stateless.StatelessFeatureLayerJ2D.paint(StatelessFeatureLayerJ2D.java:208)
at
org.geotoolkit.display2d.container.statefull.StatefullContextJ2D.paint(StatefullContextJ2D.java:162)
at
org.geotoolkit.display2d.canvas.J2DCanvas.render(J2DCanvas.java:200)
at
org.geotoolkit.display2d.canvas.J2DCanvasVolatile.render(J2DCanvasVolatile.java:211)
at
org.geotoolkit.display2d.canvas.J2DCanvasVolatile.access$400(J2DCanvasVolatile.java:52)
at
org.geotoolkit.display2d.canvas.J2DCanvasVolatile$DrawingThread.run(J2DCanvasVolatile.java:263)
the code used to create the JMap is the one given earlier in this list:
package geo;
import java.net.URL;
import org.geotoolkit.data.DataStore;
import org.geotoolkit.data.DataStoreFinder;
import org.geotoolkit.data.FeatureCollection;
import org.geotoolkit.data.query.QueryBuilder;
import org.geotoolkit.gui.swing.go2.JMap2DFrame;
import org.geotoolkit.map.MapBuilder;
import org.geotoolkit.map.MapContext;
import org.geotoolkit.util.RandomStyleFactory;
public class TestShapeFile {
public static void main(String[] args) throws Exception {
final DataStore ds = DataStoreFinder.getDataStore("url", new
URL("file:/mnt/lasb/GEOTK/V3zones_i_9.shp"));
final MapContext ctx = MapBuilder.createContext();
final FeatureCollection col =
ds.createSession(true).getFeatureCollection(QueryBuilder.all(ds.getNames().iterator().next()));
ctx.layers().add(MapBuilder.createFeatureLayer(col,
RandomStyleFactory.createRandomVectorStyle(col)));
JMap2DFrame.show(ctx);
}
}
-the list of files which are linked to the shapefile:
$ ls V3*i*
V3zones_i_9.dbf V3zones_i_9.shp V3zones_i_9.shx
after running java, the following files are created:
V3zones_i_9.fix V3zones_i_9.qix
Thank you for your help
Brigitte
More information about the Geotoolkit
mailing list