I am attempting to write some simple GeoTools based code for accessing a WFS server. The code looks like this so far:
String getCapabilities = "http://www.nws.noaa.gov/mdl/survey/pgb_survey/dev/OGC_services/ndfdOWSserver.php?SERVICE=WFS&Request=GetCapabilities";
Map<String, String> connectionParameters = new HashMap<String, String>();
connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", getCapabilities);
WFSDataStoreFactory dsf = new WFSDataStoreFactory();
try {
WFSDataStore dataStore = dsf.createDataStore(connectionParameters);
String types[] = dataStore.getTypeNames();
for (int i = 0; i < types.length; i++) {
System.out.println(types[i]);
}
SimpleFeatureSource source = dataStore.getFeatureSource("ndfd:Forecast_Gml2Point");
SimpleFeatureCollection fc = source.getFeatures();
while(fc.features().hasNext()){
SimpleFeature sf = fc.features().next();
System.out.println(sf.getAttribute("myname"));
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
This works up until the line with the call to getFeatures() at which point I get the dreaded java.lang.NoClassDefFoundError: org.hsqldb.lib.FrameworkLogger error:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.hsqldb.lib.FrameworkLogger
at org.hsqldb.persist.Logger.getEventLogger(Unknown Source)
at org.hsqldb.persist.Logger.getEventLogger(Unknown Source)
at org.hsqldb.persist.Logger.logInfoEvent(Unknown Source)
at org.hsqldb.persist.Logger.closePersistence(Unknown Source)
at org.hsqldb.Database.reopen(Unknown Source)
at org.hsqldb.Database.open(Unknown Source)
[...]
at org.geotools.data.wfs.v1_0_0.WFS_1_0_0_DataStore.getSchema(WFS_1_0_0_DataStore.java:386)
at org.geotools.data.wfs.v1_0_0.WFSFeatureSource.getSchema(WFSFeatureSource.java:207)
at org.geotools.data.wfs.v1_0_0.WFSFeatureSource.getFeatures(WFSFeatureSource.java:231)
at wfsClient.WfsClient.main(WfsClient.java:100)
Reading similar problems (such as this) suggests that hsqldb is missing from the classpath -- but it is not. I have followed the directions on this page to download the GeoTools archive and add all the Jars to my Eclipse project. (I cannot use Maven as the Eclipse Maven plugin doesn't play nicely with our proxy.) I have deleted all the suggested conflicting Jars, as well as the ones suggested in this thread. I have checked the classpath on my code and it includes the "GeoTools Download" project with all of the Jars exported. (I have also added all the jars explicitly to my classpath and get the same error.)
If I dump my project to a Ant build file, this is what the path definition looks like:
<path id="GeoTools Download.classpath">
<pathelement location="${GeoTools Download.location}/bin"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/ant-1.8.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/batik-transcoder-1.7.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/bridj-0.6-c-only.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/bufr-4.3.16.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/common-2.6.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-beanutils-1.7.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-cli-2.0-gt2-pre1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-codec-1.2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-collections-3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-dbcp-1.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-digester-1.7.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-httpclient-3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-io-2.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-jxpath-1.3.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-lang-2.6.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-logging-1.1.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/commons-pool-1.5.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/core.commands-3.6.0.I20100512-1500.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/core.runtime-3.6.0.v20100505.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/eastwood-1.1.1-20090908.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/ecore-2.6.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/ehcache-1.6.2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/equinox.common-3.6.0.v20100503.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gdal-1.8.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/geodb-0.7-RC2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/grib-4.3.16.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-api-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-app-schema-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-app-schema-resolver-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-arcgrid-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-brewer-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-charts-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-complex-13-RC1-tests.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-complex-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-coverage-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-coverage-api-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-coveragetools-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-cql-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-css-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-csv-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-data-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-epsg-hsql-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-feature-aggregate-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-feature-pregeneralized-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-geojson-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-geometry-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-geopkg-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-geotiff-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-graph-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-grassraster-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-grib-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-grid-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-gtopo30-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-image-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-imageio-ext-gdal-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-imagemosaic-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-imagemosaic-jdbc-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-imagepyramid-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-jdbc-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-jp2k-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-jts-wrapper-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-main-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-matfile5-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-mbtiles-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-metadata-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-mongodb-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-netcdf-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-ogr-bridj-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-ogr-core-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-ogr-jni-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-opengis-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-process-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-process-feature-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-process-geometry-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-process-raster-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-property-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-property-old-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-referencing-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-referencing3D-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-render-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-sample-data-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-sample-data-access-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-sfs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-shapefile-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-solr-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-svg-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-swing-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-swt-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-transform-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-validation-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-vpf-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-wfs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-wfs-ng-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-wms-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-wps-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xml-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-core-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-csw-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-fes-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-filter-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-gml2-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-gml3-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-kml-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-ows-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-sld-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-wcs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-wfs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-wms-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/gt-xsd-wps-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/h2-1.1.119.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/hsqldb-2.2.8.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/icu4j-3.4.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-arcgrid-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalarcbinarygrid-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdaldted-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalecw-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalecwjp2-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalehdr-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalenvihdr-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalerdasimg-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalidrisi-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalkakadujp2-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalmrsid-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalmrsidjp2-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalnitf-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-gdalrpftoc-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-geocore-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-imagereadmt-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-imagereadmt-1.1M012010.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-kakadu-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-mat-sas-1.1M012010.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-streams-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-tiff-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/imageio-ext-utilities-1.1.10.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jai_codec-1.1.3.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jai_core-1.1.3.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jai_imageio-1.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/javacsv-2.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jdom-1.1.3.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jface-3.6.1.M20100825-0800.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jgridshift-1.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/json-simple-1.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jsqlparser-0.3.14.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jsr-275-1.0-beta-2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-contour-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-rangelookup-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-utils-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-vectorbinarize-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-vectorize-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jt-zonalstats-1.3.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/jts-1.13.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/log4j-over-slf4j-1.6.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/miglayout-3.7-swing.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/mongo-java-driver-2.5.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/mysql-connector-java-5.1.17.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.csw-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.fes-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.ows-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.wcs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.wfs-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/net.opengis.wps-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/netcdf-4.3.16.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/opendap-2.1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/org.w3.xlink-13-RC1.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/parboiled-java-1.1.6.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/picocontainer-1.2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/postgresql-8.4-701.jdbc3.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/slf4j-log4j12-1.6.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/solr-solrj-4.9.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/spatialite-jdbc-3.7.2-2.4.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/sqlite-jdbc-3.8.6.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/swt.gtk.linux.x86-3.6.1.v3655c.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/swt.win32.win32.x86_64-3.6.1.v3655c.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/ui.workbench-3.6.1.M20100826-1330.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/vecmath-1.3.2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/xml-commons-resolver-1.2.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/xpp3_min-1.1.4c.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/xpp3-1.1.3.4.O.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/xsd-2.6.0.jar"/>
<pathelement location="${GeoTools Download.location}/geotools-13-RC1/slf4j-log4j-1.6.4.jar"/>
</path>
<path id="WFS Client Project.classpath">
<pathelement location="bin"/>
<path refid="GeoTools Download.classpath"/>
</path>
You'll see there's just the one epsg jar file in there, and just the one jdbc jar. I have done the same thing with version 12.2 with the same results.
Any ideas on how to fix this problem? Any help appreciated!