[geotk] NullPointerException with WFSFeatureStore

Emmanuel Blondel emmanuel.blondel1 at gmail.com
Mon Dec 8 14:18:02 PST 2014


Hello,

I'm currently assessing the WFS client from Geotoolkit. We would like to 
use it in a new project (also because we would like to use Apache SIS 
progressively), with the purpose to discover featuretypes and fetch the 
featureCollection data, relying on the official GeoAPI.

I've been trying to use Geotoolkit 4.0-M2 (which AFAIK is the latest 
milestone release), and the geotk-wfs-client.

I get the following stack trace :

/déc. 08, 2014 11:11:58 PM org.geotoolkit.data.wfs.WebFeatureClient 
getCapabilities//
//AVERTISSEMENT: TimeOut error, the server takes too much time to answer. //
//Exception in thread "main" java.lang.NullPointerException//
//    at 
org.geotoolkit.data.wfs.WFSFeatureStore.checkTypeExist(WFSFeatureStore.java:114)//
//    at 
org.geotoolkit.data.wfs.WFSFeatureStore.<init>(WFSFeatureStore.java:107)//
//    at org.fao.fi.wfstesting.App.main(App.java:33)/


for this code:

         final WebFeatureClient wfsServer = new WebFeatureClient(new 
URL("http://www.fao.org/figis/geoserver/ows"), "1.1.0");
         final GetCapabilitiesRequest getCapa = 
wfsServer.createGetCapabilities();

         final GetFeatureRequest getFeature = wfsServer.createGetFeature();
         //simplify WFS like a datastore
         final FeatureStore store = new WFSFeatureStore(wfsServer);

         String[] typeNames = store.getTypeNames();
         for(String typeName : typeNames){
             FeatureType ft = store.getFeatureType(typeName);
             System.out.println(ft.getName());
             System.out.println("==");
         }

I admit i'm lost. I had a look to the code for which i identified the 
timeout warning.
But nothing about the exception. Any idea?

Thanks in advance for your help
Emmanuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20141208/302f2f23/attachment.html>


More information about the Geotoolkit mailing list