[geotk] trouble with jai
Brigitte Charnomordic
bch at supagro.inra.fr
Tue Feb 8 10:49:11 EST 2011
Hello,
My first steps with geotoolkit (I used geotools before) and my first
trouble :
After downloading the latest bundles and installing the jai extension
(on Linux CentOs 64 bits)
I tried the simple example given earlier in this mail list to read a
shapefile of mine :
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_k_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);
}
}
compilation is successful, but I get the following error message ar runtime:
java -cp
./bin/class:/home/brigitte/GEO/geotk-bundle-3.16.jar:/home/brigitte/GEO/geotk-bundle-pending-3.16.jar
geo/TestShapeFile
Error while parsing JAI registry file
"file:/home/brigitte/GEO/geotk-bundle-pending-3.16.jar!/META-INF/registryFile.jai
" :
Error in registry file at line number #29
A descriptor is already registered against the name
"org.geotoolkit.Combine" under registry mode "rendered"
Error in registry file at line number #30
A descriptor is already registered against the name
"org.geotoolkit.Hysteresis" under registry mode "rendered"
Error in registry file at line number #31
A descriptor is already registered against the name
"org.geotoolkit.NodataFilter" under registry mode "rendered"
Error in registry file at line number #32
A descriptor is already registered against the name
"org.geotoolkit.SilhouetteMask" under registry mode "rendered"
Error in registry file at line number #33
A descriptor is already registered against the name
"org.geotoolkit.Mask" under registry mode "rendered"
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Thanks for your help
Brigitte
More information about the Geotoolkit
mailing list