If you add a shapefile service with a file that doesnt exist
you get a Null pointer exception instead of a file not found exception

in a class that extends DefaultCatalog
...
shapeUri = new URI("file:///home/andy/shp/Muni_Ant.shp");       Map params=new
HashMap();
params.put("url",new URL("file://home/andy/shp/Muni_Ant.shp")); // note
there are only 2 / there should be 3
Service service=new ShapefileService(this,shapeUri,params);                     
add(service);
...
later on in the service getInfo method:

Exception in thread "main" java.lang.NullPointerException
        at org.geotools.catalog.shapefile.ShapefileGeoResource.getInfo
(ShapefileGeoResource.java:101)
        at com.hazlorealidad.geo.GeoCatalog.main(GeoCatalog.java:193)

In several other places I encountered a NPE when trying to develop a
Catalog (really because I didnt know what I was doing) and had to
download the source to find out what the real problem was. Not something
everyone would want to do.

It would be cool when rethrowing an exception in the catalog api to add
the last one as a nested exception.

Thanks to all the developers for your hard work.

Andy Bailey
Hazlorealidad.com


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to