Michael, thanks for the quick reply. Unfortunately I am also having problems with V8.
Hello Rafael,

I've tried the steps in
http://docs.geotools.org/latest/userguide/tutorial/quickstart/netbeans.html
(without using maven, I've just added all .jars from the binary
distribution to my project).
The source code in that example does not compile -- the error is
   method showMap in class org.geotools.swing.JMapFrame cannot be
applied to given types;
   required: org.geotools.map.MapContext
This sounds like a confusion of versions. Perhaps you are working with
the latest quickstart code, which is intended to be used with GeoTools
version 8, but compiling it against GeoTools 2.7 ?  It works as
advertised with GeoTools v8.

Here are my steps:

 * Downloaded Geotools 8.0 M4 and unzipped it.
 * Create a new project in Netbeans.
 * Instead of using maven (please see excuse below) I've manually added
   all .jars to my project.
 * Got the code from (it says "GeoTools 8.0-M3 User Guide, but...") and
   copied it, only changed the name of the package.
 * Got an exception (shown at the end of the message).


I'm not using maven because for this project I will add some other jars and since I am not familiar with it I decided to skip an additional layer of complexity. If it is absolutely required I would reconsider. I am on a Mac, so Java is 1.6 and JAI is already installed. Here are the exceptions, which I sort of understand but seems to me some jars are missing.
Should I go to V8 M3 or (gasp) use maven to solve this?

thanks
Rafael


run:
Exception in thread "main" java.lang.NoClassDefFoundError: it/geosolutions/imageio/gdalframework/GDALImageReaderSpi
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.misc.Service$LazyIterator.next(Service.java:271)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:190)
    at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:121)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:142)
    at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1335)
    at apple.awt.CToolkit.<init>(CToolkit.java:144)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at java.awt.Toolkit$2.run(Toolkit.java:859)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at javax.swing.JFileChooser.installShowFilesListener(JFileChooser.java:369)
    at javax.swing.JFileChooser.setup(JFileChooser.java:354)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:333)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:286)
at org.geotools.swing.data.JFileDataStoreChooser.<init>(JFileDataStoreChooser.java:130) at org.geotools.swing.data.JFileDataStoreChooser.<init>(JFileDataStoreChooser.java:114) at org.geotools.swing.data.JFileDataStoreChooser.<init>(JFileDataStoreChooser.java:66) at org.geotools.swing.data.JFileDataStoreChooser.showOpenFile(JFileDataStoreChooser.java:227) at org.geotools.swing.data.JFileDataStoreChooser.showOpenFile(JFileDataStoreChooser.java:211)
    at QuickStart.main(QuickStart.java:30)
Caused by: java.lang.ClassNotFoundException: it.geosolutions.imageio.gdalframework.GDALImageReaderSpi
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 39 more
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to