From: Emmanuel B. <emm...@gm...> - 2012-11-27 09:30:18
|
Hello all, Since a few weeks, i don't know why but the WFS Datastore does not work anymore in my codes. I'm using GeoTools 8.2. Here the sample code I run: /SimpleFeatureCollection result = null;// // try{// //// // String wfsGetCap = "http://localhost:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetCapabilities";// //// // // use the WFS Datastore// // Map<String, Serializable> params = new HashMap<String, Serializable>();// // params.put(WFSDataStoreFactory.URL.key, wfsGetCap);// // params.put(WFSDataStoreFactory.TIMEOUT.key, new Integer(60000));// //// // DataStore datastore = DataStoreFinder.getDataStore(params);// // SimpleFeatureSource featureSource = datastore.getFeatureSource("mylayer");// //// //// // result = featureSource.getFeatures();// //// // }catch(Exception e){// // new RuntimeException("Unable to get the target collection", e);// // }// //// //System.out.println(result.size());/ and the error i get: /Exception in thread "main" java.lang.NoSuchMethodError: org.geotools.filter.capability.FunctionNameImpl.parameter(Ljava/lang/String;Ljava/lang/Class;)Lorg/opengis/parameter/Parameter;// // at org.geotools.filter.function.FilterFunction_setCRS.<clinit>(FilterFunction_setCRS.java:32)// // at java.lang.Class.forName0(Native Method)// // at java.lang.Class.forName(Class.java:247)// // at sun.misc.Service$LazyIterator.next(Service.java:271)// // at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:823)// // at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:769)// // at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:802)// // at org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:195)// // at org.geotools.factory.CommonFactoryFinder.getFunctions(CommonFactoryFinder.java:147)// // at org.geotools.filter.FilterNameTypeMapping.loadFunctionNameMap(FilterNameTypeMapping.java:157)// // at org.geotools.filter.FilterNameTypeMapping.<clinit>(FilterNameTypeMapping.java:35)// // at org.geotools.filter.FilterCapabilities.findOperation(FilterCapabilities.java:453)// // at org.geotools.xml.filter.FilterComplexTypes$Spatial_OperatorsType.getValue(FilterComplexTypes.java:881)// // at org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:187)// // at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:263)// // at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)// // at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)// // at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)// // at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)// // at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)// // at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)// // at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)// // at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)// // at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)// // at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)// // at org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:133)// // at org.geotools.data.wfs.v1_0_0.WFS100ProtocolHandler.parseCapabilities(WFS100ProtocolHandler.java:66)// // at org.geotools.data.wfs.v1_0_0.WFS100ProtocolHandler.<init>(WFS100ProtocolHandler.java:47)// // at org.geotools.data.wfs.WFSDataStoreFactory.createDataStore(WFSDataStoreFactory.java:376)// // at org.geotools.data.wfs.WFSDataStoreFactory.createDataStore(WFSDataStoreFactory.java:118)// // at org.geotools.data.DataAccessFinder.getDataStore(DataAccessFinder.java:129)// // at org.geotools.data.DataStoreFinder.getDataStore(DataStoreFinder.java:88)// // at org.fao.figis.gis.wps.process.feature.App.main(App.java:32)/ Could somebody help me in identifying what's the issue and solve it? In other case, does anyone know an efficient way to get feature collections from WFS (possibly applying a filter)? Thanks in advance Emmanuel |