On Wed, Mar 30, 2011 at 7:27 PM, Jason Ferguson <[email protected]> wrote: > I'm having an issue processing a Shapefile and can't get past the > initialization of the datastore. Here's the code (up to the error): > > public void processShapefile(String shapefileName) throws ServiceException > { > String tmpFileDir = System.getProperty("java.io.tmpdir"); > > File shapeFile = new File(tmpFileDir, shapefileName); > > if (!shapeFile.exists()) { > throw new ServiceException("Shapefile " + shapefileName + > " not found!"); > } > > ShapefileDataStore dataStore = null; > try { > dataStore = new ShapefileDataStore(shapeFile.toURI().toURL()); > } catch (MalformedURLException e) { > throw new ServiceException("processShapefile() throw > MalformedURLExeception: ", e); > } catch (Throwable ex) { > ex.printStackTrace(); > } > > if (dataStore==null) { > throw new ServiceException("ShapefileDataStore was null"); > } > > // snip > } > > Unfortunately, this throws a java.lang.ExceptionInInitializerError, > caused by a java.lang.ClassCastException. I'm a noob, so any help is > appreciated. I updated from 2.6.5 to 2.7.0 with no change.
My guess is that you did not update fully, you probably still have some old jar lurking around mixed with the newer ones Cheers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
