This is the test app to test the new JARs :
import java.io.File;
import java.io.IOException;
import org.geotools.data.FileDataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.data.simple.SimpleFeatureSource;
import org.geotools.map.DefaultMapContext;
import org.geotools.map.FeatureLayer;
import org.geotools.map.Layer;
import org.geotools.map.MapContent;
import org.geotools.map.MapContext;
import org.geotools.styling.SLD;
import org.geotools.styling.Style;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;
public class Test {
public static void main(String[] args) throws IOException {
new Test();
}
Test() throws IOException{
File file = JFileDataStoreChooser.showOpenFile("shp", null);
if (file == null) {
return;
}
FileDataStore store = FileDataStoreFinder.getDataStore(file);
SimpleFeatureSource featureSource = store.getFeatureSource();
// Create a map content and add our shapefile to it
MapContent map = new MapContent();
map.setTitle("Quickstart");
Style style = SLD.createSimpleStyle(featureSource.getSchema());
Layer layer = new FeatureLayer(featureSource, style);
map.addLayer(layer);
JMapFrame.showMap((MapContext) map);
}
}
and this was the result :
Jul 11, 2011 6:03:00 PM org.geotools.filter.function.DefaultFunctionFactory
getFunctionName
WARNING: class org.geotools.filter.function.FilterFunction_bufferWithSegments
has name conflict betwee 'bufferWithSegments' and 'buffer'
Jul 11, 2011 6:03:00 PM org.geotools.filter.function.DefaultFunctionFactory
loadFunctions
WARNING: Function area clash between AreaFunction and FilterFunction_area
Jul 11, 2011 6:03:00 PM org.geotools.filter.function.DefaultFunctionFactory
loadFunctions
WARNING: Function in10 clash between FilterFunction_in9 and FilterFunction_in8
Jul 11, 2011 6:03:00 PM org.geotools.filter.function.DefaultFunctionFactory
loadFunctions
WARNING: Function in10 clash between FilterFunction_in8 and FilterFunction_in10
Jul 11, 2011 6:03:01 PM org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can't load a service for category "ProcessFactory". Cause is
"NoClassDefFoundError: javax/media/jai/PropertySourceImpl".
Jul 11, 2011 6:03:01 PM org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can't load a service for category "ProcessFactory". Cause is
"NoClassDefFoundError: javax/media/jai/PropertySourceImpl".
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/JAI
at
org.geotools.coverage.processing.CoverageProcessor.<clinit>(CoverageProcessor.java:155)
at
org.geotools.renderer.lite.StreamingRenderer.<clinit>(StreamingRenderer.java:210)
at org.geotools.swing.JMapFrame.<init>(JMapFrame.java:153)
at org.geotools.swing.JMapFrame.showMap(JMapFrame.java:124)
at Test.<init>(Test.java:45)
at Test.main(Test.java:26)
Caused by: java.lang.ClassNotFoundException: javax.media.jai.JAI
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
________________________________
De : Michael Bedward <michael.bedw...@gmail.com>
À : Chaouki Soussi <chaouki.sou...@yahoo.fr>
Cc : Jody Garnett <jody.garn...@gmail.com>;
"geotools-gt2-users@lists.sourceforge.net"
<geotools-gt2-users@lists.sourceforge.net>
Envoyé le : Lundi 11 Juillet 2011 10h38
Objet : Re: Re : JAI install required for GeoTools? How to fix ...
Hi Chaouki,
If possible, could you reduce your program to a small test app that
produces this error and send me the source code off list.
cheers
Michael
On 11 July 2011 16:30, Chaouki Soussi <chaouki.sou...@yahoo.fr> wrote:
> Hi everybody,
> Sorry about the lateness but I was in travel last weekend.
> I have downloaded the new JARs (geotools-8.0-M1) but they don't seem to be
> working good. I receive this message when I try to compile the application :
> "Could not find main class : MainClass. Program will exit"
> And this is displayed in the console :
> "java.lang.NoClassDefFoundError: javax/media/jai/JAI
> at
> org.geotools.coverage.processing.CoverageProcessor.<clinit>(CoverageProcessor.java:155)
> at
> org.geotools.renderer.lite.StreamingRenderer.<clinit>(StreamingRenderer.java:210)
> at org.geotools.swing.JMapFrame.<init>(JMapFrame.java:153)
> at org.geotools.swing.JMapFrame.<init>(JMapFrame.java:143)
> at MainClass.<clinit>(MainClass.java:138)
> Caused by: java.lang.ClassNotFoundException: javax.media.jai.JAI
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 5 more
> Exception in thread "main" "
>
> I Tried to work with the 2.6.0 version and I don't have any errors in
> compilation but in this version there is no kind of displaying of LayerTable
> or ToolBar or StatusBar. And I think that the management of the raster
> coverage is not with the same way.
> Best regards.
> Chaouki Soussi
>
>
>
>
>
> ________________________________
> De : Jody Garnett <jody.garn...@gmail.com>
> À : Chaouki Soussi <chaouki.sou...@yahoo.fr>; Michael Bedward
> <michael.bedw...@gmail.com>
> Cc : "geotools-gt2-users@lists.sourceforge.net"
> <geotools-gt2-users@lists.sourceforge.net>
> Envoyé le : Lundi 11 Juillet 2011 0h40
> Objet : JAI install required for GeoTools? How to fix ...
>
> I have had a second report of this problem (this time from a customer so I
> have to fix it!)
> Short term:
> - It was resolved by installing JAI + ImageIO into the JRE (as per the
> quickstart links);
> - however I don't think that should be a required fix....
> Long term:
> It would make sense to me that JAI would be supplied as a "provided"
> dependency in maven. This would allow people to use JAI if they have
> installed in in their JRE; or they could add it to their application via
> maven.
> Let me check with "mvn dependency:tree"
> [INFO] org.geotools:gt-swing:jar:8-SNAPSHOT
> [INFO] +- org.geotools:gt-render:jar:8-SNAPSHOT:compile
> [INFO] | +- org.geotools:gt-main:jar:8-SNAPSHOT:compile
> [INFO] | | +- org.geotools:gt-api:jar:8-SNAPSHOT:compile
> [INFO] | | +- com.vividsolutions:jts:jar:1.12:compile
> [INFO] | | | \- xerces:xercesImpl:jar:2.7.1:compile (version managed from
> 2.4.0)
> [INFO] | | \- jdom:jdom:jar:1.0:compile
> [INFO] | +- org.geotools:gt-coverage:jar:8-SNAPSHOT:compile
> [INFO] | | +-
> it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.0:compile
> [INFO] | | | +-
> it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.0:compile
> [INFO] | | | +- javax.media:jai_codec:jar:1.1.3:compile
> [INFO] | | | \- javax.media:jai_imageio:jar:1.1:compile
> [INFO] | | +- org.jaitools:jt-zonalstats:jar:1.2.0:compile
> [INFO] | | \- org.jaitools:jt-utils:jar:1.2.0:compile
> [INFO] | \- org.geotools:gt-cql:jar:8-SNAPSHOT:compile
> [INFO] +- org.geotools:gt-wms:jar:8-SNAPSHOT:compile
> [INFO] | +- org.geotools:gt-referencing:jar:8-SNAPSHOT:compile
> [INFO] | | +- java3d:vecmath:jar:1.3.2:compile
> [INFO] | | +- commons-pool:commons-pool:jar:1.5.4:compile
> [INFO] | | \- org.geotools:gt-metadata:jar:8-SNAPSHOT:compile
> [INFO] | | \- org.geotools:gt-opengis:jar:8-SNAPSHOT:compile
> [INFO] | | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
> [INFO] | \- org.geotools:gt-xml:jar:8-SNAPSHOT:compile
> [INFO] +- org.geotools:gt-shapefile:jar:8-SNAPSHOT:test
> [INFO] | \- org.geotools:gt-data:jar:8-SNAPSHOT:test
> [INFO] +- com.miglayout:miglayout:jar:swing:3.7:compile
> [INFO] +- javax.media:jai_core:jar:1.1.3:provided (scope not updated to
> compile)
> [INFO] \- junit:junit:jar:4.4:test
> So there it is listed "as provided"; leaving people the option of if they
> add it or install locally.
> Q: Is Quickstart broken?
> Micheal Bedward - do we need to update our Quickstart with a maven
> dependency on jai so it works "out of the box"?
> Q: Is the download complete?
> Chanouki - I did not hear from you about the jars being included in the
> download? I have released 8.0-M1 which *does* include the jars. Can you try
> this out and confirm that this works for you - and fixes the problem??
> --
> Jody Garnett
>
> On Saturday, 9 July 2011 at 12:20 AM, Jody Garnett wrote:
>
> I am assembling the 8.0-M1 distribution now and did a quick check:
>> ls ja*
> jai_codec-1.1.3.jar jai_imageio-1.1.jar
> So the JAI jars are there; can you confirm you see them on your side?
> --
> Jody Garnett
>
> On Friday, 8 July 2011 at 9:01 PM, Jody Garnett wrote:
>
> Good Evening Chaouki:
>
> I have a problem to run my project with the download geotools alternative to
> M2Eclipse
> (http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html).
>
> Thanks for testing! I would love some feedback on that one ...
>
> I have this messages when I try to run it :
> java.lang.NoClassDefFoundError: javax/media/jai/PropertySource
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> at java.lang.ClassLoader.defineClass(Unknown Source)
>
> The JAI jar is sometimes installed in your JRE (it is a java extension). I
> think we tried to include it in the download but it could be a mistake ...
> You can however download from the website; the instructions are at the top
> of the quick start.
>
> when I want to remove the jar files like it was explained in the procedure :
> http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html
> I didn't found some of them in the downloaded zip file
> geotools-8.0-M0-bin.zip(
>
> gt-epsg-h2
> gt-epsg-oracle
> gt-db2
> gt-oracle-spatial
> gt-jdbc-oracle )
>
> Some of them are old and have been retired; gt-db2, gt-oracle-spatial and so
> on; so I bet I need to update that list. What ones *were* there?
>
> Someone can give the right procedure to install jars in my project please
> with the version 8.0 of geotools.
>
> I don't have a download of 8.0-M0 handy; but I am assembling 8.0-M1 later
> this weekend. I will try and go through and update the instructions; if you
> can check them for me after to see if they work :-)
>
> I tried the m2eclipse method the project run perfectly but I didn't found
> how to export it in a runnable jar's.
>
> Interesting question; I am not a maven expert - I know that they have tools
> to package up WARs for application servers; they may have something to
> package up an application.
> There is an "assembly" plugin; which is the subject of a couple of FAQ
> questions in the user guide; perhaps that is what assembly does.
>
> I have a windows 7 64 bit and an Eclipse Helios environment.
>
> Nice.
> Jody
>
>
>
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users