From: TundraGreen <wi...@th...> - 2008-10-15 18:19:36
|
I have exactly the same problem that John had from the same source, implementing the "How to read a shapefile example". I have read Jody's response and tried to implement it. I don't have any problem including something in the META-INF/servies folder in the jar. I know how to do that. But I haven't been able to figure out what to include. I tried following the directions in the API for implementing a DataStoreFactorySpi. These suggest the following: [Begin quote from API] Implementation Notes An instance of this interface should exist for all data stores which want to take advantage of the dynamic plug-in system. In addition to implementing this factory interface each DataStore implementation should have a services file: META-INF/services/org.geotools.data.DataStoreFactorySpi The file should contain a single line which gives the full name of the implementing class. example: e.g. org.geotools.data.mytype.MyTypeDataSourceFacotry The factories are never called directly by client code, instead the DataStoreFinder class is used. [/End quote from API] I don't know if this is what Jody was referring to, but in any event I haven't been able to find anything that works. Can anyone provide more detail about what is required to get org.geotools.filter.FunctionFinder.findFunction(FunctionFinder.java:xx) to be able to find the Length function. Will Jody Garnett wrote: > > 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). > > Jody > > >> >> >> 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 > > -- View this message in context: http://www.nabble.com/RuntimeException%3A-Unable-to-find-function-Length-tp18576842p19998467.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |