Geotools attempting to load up an hsqldb jdbc datasource when reading a shapefile... any ideas?

613 vues
Accéder directement au premier message non lu

Brian Ferris

non lue,
10 févr. 2010, 14:54:4610/02/2010
à opentripp...@googlegroups.com
If anyone with more Geotools experience could chime in here...

I've been working to add GTFS Hibernate persistence into the graph-builder, which includes playing with using hsqldb as a backend data store.  I've actually got that part working, but I run into trouble when I try to load up the street network from a shape file.  I getting an exception (see below) that looks like geotools is trying to configure an hsqldb jdbc data source for working with the shapefile.  As best as I can tell from tracing through the source, the act of adding hsqldb to the classpath seems to have triggered a check in the FactoryRegistry that will try to instantiate an hsqldb data source.  The problem is that I'm using hsqldb-2.0.0, which has a jdbc driver with a different name than the 1.8.0 series, and thus the exception.

Is there any way of disabling the hsqdlb check in geotools?

Thanks,
Brian


Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/jdbc/jdbcDataSource
at org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory.createDataSource(ThreadedHsqlEpsgFactory.java:204)
at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:375)
at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:423)
at org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:132)
at org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:233)
at org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:119)
at org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:668)
at org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:500)
at org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:436)
at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:364)
at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:143)
at org.geotools.referencing.ReferencingFactoryFinder.getAuthorityFactory(ReferencingFactoryFinder.java:216)
at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactory(ReferencingFactoryFinder.java:436)
at org.opentripplanner.graph_builder.impl.shapefile.ShapefileStreetGraphBuilderImpl.buildGraph(ShapefileStreetGraphBuilderImpl.java:75)
at org.opentripplanner.graph_builder.GraphBuilderTask.run(GraphBuilderTask.java:72)
at org.opentripplanner.graph_builder.GraphBuilderMain.main(GraphBuilderMain.java:49)
Caused by: java.lang.ClassNotFoundException: org.hsqldb.jdbc.jdbcDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

Justin Deoliveira

non lue,
10 févr. 2010, 15:21:1910/02/2010
à opentripp...@googlegroups.com
By default GeoTools uses an hsql database internally to store the epsg
database. You can however plug in other options. There is a somewhat
experimental version of it that is based on h2 rather than hsql. But it
is only available in later versions of GeoTools. What version are you using?

You can also use the wkt epsg provider instead of the hsql one. However
it is more limited in terms of the transformations between coordinate
reference systems it provides. But if heavy reprojection is not a use
case for you then it should not be a problem.

Assuming you are working with a geotools binary release simply remove
the gt-epsg-hsql*.jar from your classpath and make sure the
gt-epsg-wkt*.jar is around. And then try again.

-Justin


--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message