Hi there,

at the moment I am using Geotools in a project where we can't use Maven, 
because we use a different building system yet. So I'm using the jars to make 
it work.
Unfortunately, this seems to cause some trouble.
First, I added ALL the jars to my project, as suggested in the Eclipse 
Quickstart tut.. but this causes the ImageIO to crash, when I want to render a 
map and write it to a file. At the moment, I'm trying the other way; removing 
all jars, and adding only the ones which seem to be necessary (until all the 
packages can be found).

But now, my program crashes at this point
        FileDataStore store;
             try {
                    store = FileDataStoreFinder.getDataStore(file);
                    featureSource = store.getFeatureSource();
             } catch (Exception e) {
             System.out.println("Error fetching data from shape file. Exit");
                    e.printStackTrace();
             }

with a NullPointerException, because getDataStore(File) returns null. I used 
debug mode, and stepped into it, and found out that in 
CommonFactoryFinder.getFileDataStoreFactories(Hints) causes this, on the return 
line
    public static synchronized Set<FileDataStoreFactorySpi> 
getFileDataStoreFactories(Hints hints) {
        hints = mergeSystemHints(hints);
        return new 
LazySet<FileDataStoreFactorySpi>(getServiceRegistry().getServiceProviders(
                FileDataStoreFactorySpi.class, null, hints));
    }

This is strange, as both the jars containing the LazySet and the 
FileDataStoreFactorySpi are linked (gt-metadata-9.4.jar), but one of them seems 
to be missing (or another one is disturbing?!).

Does anyone know how I could solve this? Are there any jars which could be 
missing, or which are unnecessary?
(At the moment, I'm using the following jars:
gt-api-9.4.jar
gt-coverage-9.4.jar
gt-main-9.4.jar
gt-metadata-9.4.jar
gt-opengis-9.4.jar
gt-referencing-9.4.jar
gt-render-9.4.jar
gt-swing-9.4.jar
jts-1.13.jar
)

Furthermore, is there a better way to deal with problems like this than 
manually adding jar which seem to contain the right content? This is a very 
annoying and exhausting way...

Thanks in advance!
Philipp
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to