From: Jody G. <jga...@re...> - 2008-07-21 20:40:30
|
I can help with that one ... we make use of Factory Service Provider Interface (ie Factory SPI) which makes use of META_INF/services/* (a folder in your jar that advertises all the services the jar offers - including the length function). So when you do mvn assembly - you will need to make sure the META_INF/services files are all merged up (no I don't know how to do this). The length function is being called when you make an attribute type; the shapefile header has a limitation that strings can only be 256 characters long; we represent that as a restriction - the restriction that "length( . ) < 256". Cheers, Jody Joh...@no... wrote: > Helllo All, > > I have a very simple shapefile reading class based on the example > (http://docs.codehaus.org/display/GEOTDOC/04+How+to+Read+a+Shapefile). > > Everything works OK when executing w/ "mvn exec:java". However, when I > bundle everything up into a executable jar using "mvn > assembly:assembly", I get a RuntimeException trying to use the generated > jar file. I can't understand why there's a problem locating a function > "length" nor really why it's being called. Any suggestions? > > Thanks! > --john > > > java -jar ./target/shapefile-reader-jar-with-dependencies.jar > ~/shapefiles/country.shp > > java.lang.RuntimeException: Unable to find function Length > at > org.geotools.filter.FunctionFinder.findFunction(FunctionFinder.java:83) > at > org.geotools.filter.FilterFactoryImpl.function(FilterFactoryImpl.java:423) > at > org.geotools.feature.DefaultAttributeTypeFactory.createAttributeType(DefaultAttributeTypeFactory.java:158) > at > org.geotools.feature.AttributeTypeFactory.newAttributeType(AttributeTypeFactory.java:92) > at > org.geotools.data.shapefile.ShapefileDataStore.readAttributes(ShapefileDataStore.java:703) > at > org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getSchema(IndexedShapefileDataStore.java:898) > at > org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getSchema(IndexedShapefileDataStore.java:892) > at > org.geotools.data.shapefile.indexed.IndexedShapefileDataStore.getFeatureSource(IndexedShapefileDataStore.java:1002) > at gov.noaa.eds.App.main(App.java:49) > > ------------------------------------------------------------------------- > 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-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |