WFSDataStore bug
----------------
Key: GEOT-2077
URL: http://jira.codehaus.org/browse/GEOT-2077
Project: GeoTools
Issue Type: Bug
Components: data wfs
Affects Versions: 2.4-RC0
Environment: Windows Vista, JRE 1.6.0_03
Reporter: aengus mccullough
The following error occurs when featureSource.getSchema() is called:
Exception in thread "main" java.lang.AbstractMethodError:
org.geotools.data.wfs.WFSFeatureSource.getSchema()Lorg/opengis/feature/type/FeatureType;
at org.geotools.demo.example.WFSDemo.main(WFSDemo.java:76)
-----------------------------------------------------------------------------------------------
Using geotools 2.4. and a WFS1.0 (also doesn;t work for WFS 1.1)
Example code follows:
_________________________________________________________
public class WFSDemo {
public static void main(String[] args){
System.out.println("WFS Demo");
try{
//turns off logging for xml parsing
XMLSAXHandler.setLogLevel(Level.OFF);
//create a transaction handle
Transaction t = new DefaultTransaction("handle");
t.putProperty("hint",new Integer(7));
//get wfs connection
URL getcap = new
URL("http://localhost:8080/geoserver/wfs?version=1.0.0&request=getcapabilities&service=wfs");
Map map = new HashMap();
map.put("WFSDataStoreFactory:GET_CAPABILITIES_URL",getcap);
//create a datastore
DataStore wfs = (new WFSDataStoreFactory()).createNewDataStore(map);
//get layers..
String typeNames[] = wfs.getTypeNames();
String typeName = typeNames[0];
//get features...
FeatureSource source = wfs.getFeatureSource(typeName);
FeatureType schema = source.getSchema();
FeatureCollection results = source.getFeatures();
}catch(IOException e){
e.printStackTrace();
} catch(Exception e){
e.printStackTrace();
}
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel