Hello Doeslei,

Please reply to the list rather than to me individually.

The dependencies in your pom.xml (bottom of this message) are likely
to create conflicts. For the tutorial you should include only the
dependencies that are shown in the example:

gt-main
gt-referencing
gt-epsg-hsql
gt-jdbc-postgis
gt-shapefile
gt-swing.

All of the other required jars will be included by maven automagically
when it examines the dependencies of those dependencies (known as
transitive dependencies). You can see this if you put the above
dependencies in your pom.xml file and then ask maven to list what is
actually included with the command "mvn dependency:tree". It get this:

+- org.geotools:gt-main:jar:8-SNAPSHOT:compile
|  +- org.geotools:gt-api:jar:8-SNAPSHOT:compile
|  +- com.vividsolutions:jts:jar:1.12:compile
|  |  \- xerces:xercesImpl:jar:2.4.0:compile
|  +- jdom:jdom:jar:1.0:compile
|  \- javax.media:jai_core:jar:1.1.3:compile
+- org.geotools:gt-referencing:jar:8-SNAPSHOT:compile
|  +- java3d:vecmath:jar:1.3.2:compile
|  +- commons-pool:commons-pool:jar:1.5.4:compile
|  \- org.geotools:gt-metadata:jar:8-SNAPSHOT:compile
|     \- org.geotools:gt-opengis:jar:8-SNAPSHOT:compile
|        \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
+- org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT:compile
|  \- hsqldb:hsqldb:jar:1.8.0.7:compile
+- org.geotools.jdbc:gt-jdbc-postgis:jar:8-SNAPSHOT:compile
|  +- postgresql:postgresql:jar:8.4-701.jdbc3:compile
|  \- org.geotools:gt-jdbc:jar:8-SNAPSHOT:compile
|     +- commons-dbcp:commons-dbcp:jar:1.3:compile
|     \- commons-collections:commons-collections:jar:3.1:compile
+- org.geotools:gt-shapefile:jar:8-SNAPSHOT:compile
|  \- org.geotools:gt-data:jar:8-SNAPSHOT:compile
\- org.geotools:gt-swing:jar:8-SNAPSHOT:compile
   +- org.geotools:gt-render:jar:8-SNAPSHOT:compile
   |  +- org.geotools:gt-coverage:jar:8-SNAPSHOT:compile
   |  |  +- javax.media:jai_imageio:jar:1.1:compile
   |  |  +- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.0:compile
   |  |  |  +- 
it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.0:compile
   |  |  |  \- javax.media:jai_codec:jar:1.1.3:compile
   |  |  +- org.jaitools:jt-zonalstats:jar:1.2.0:compile
   |  |  \- org.jaitools:jt-utils:jar:1.2.0:compile
   |  \- org.geotools:gt-cql:jar:8-SNAPSHOT:compile
   \- com.miglayout:miglayout:jar:swing:3.7:compile

An example of a possible conflict is that your pom includes hsqldb
version 2.0.0, however GeoTools itself is using an earlier version
(1.8.0.7 in the listing above). I've no idea if version 2.0.0 is
backwards compatible with this but it is best to assume it is not and
just let maven pull in the one required by GeoTools.

You are also including a GeoToolkit jar. Unless you have a detailed
knowledge of GeoTools and GeoToolkit modules it is best to never mix
jars from the two projects. In this case you should replace that jar
with gt-epsg-hsql.

Hope this helps,
Michael


On 3 November 2011 03:17, Doeslei Schuster <[email protected]> wrote:
> What I have inserted in the maven pom.xml is:
> <Project
>     xmlns = "http://maven.apache.org/POM/4.0.0";
>     xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance";
>     xsi: schemaLocation = "http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>     <modelVersion> 4.0.0 </ modelVersion>
>     <groupId> org.geotools </ groupId>
>     <artifactId> tutorial </ artifactId>
>     VERSION 0.0.1-SNAPSHOT </ version>
>     <packaging> jar </ packaging>
>     <name> tutorial </ name>
>     <url> http://maven.apache.org </ url>
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId> org.apache.maven.plugins </ groupId>
>                 <artifactId> maven-compiler-plugin </ artifactId>
>                 VERSION 2.0.2 </ version>
>                 <configuration>
>                     <source> 1.5 </ source>
>                     <target> 1.5 </ target>
>                 </ Configuration>
>             </ Plugin>
>         </ Plugins>
>     </ Build>
>     <properties>
>         <project.build.sourceEncoding> UTF-8 </
> project.build.sourceEncoding>
>         <geotools.version> 8.0-M2 </ geotools.version>
>     </ Properties>
>     <dependencies>
>         <dependency>
>             <groupId> junit </ groupId>
>             <artifactId> junit </ artifactId>
>             VERSION 3.8.1 </ version>
>             <scope> test </ scope>
>         </ Dependency>
>         <dependency>
>             <groupId> org.geotools </ groupId>
>             <artifactId> gt-shapefile </ artifactId>
>             geotools.version $ {VERSION} </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> org.geotools </ groupId>
>             <artifactId> gt-swing </ artifactId>
>             geotools.version $ {VERSION} </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> org.netbeans.external </ groupId>
>             <artifactId> maven-embedder-2.1-patched-20080623 </ artifactId>
>             RELEASE691 VERSION </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> net.sourceforge.javacsv </ groupId>
>             <artifactId> javacsv </ artifactId>
>             VERSION 2.0 </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> org.hsqldb </ groupId>
>             <artifactId> hsqldb </ artifactId>
>             VERSION 2.0.0 </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> org.postgis </ groupId>
>             <artifactId> postgis-jdbc </ artifactId>
>             VERSION 1.3.3 </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> org.geotoolkit </ groupId>
>             <artifactId> geotk-EPSG </ artifactId>
>             geoapi-VERSION 3.18-3.0 </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> toplink.essentials </ groupId>
>             <artifactId> toplink-essentials-agent </ artifactId>
>             VERSION 2.0-36 </ version>
>         </ Dependency>
>         <dependency>
>             <groupId> toplink.essentials </ groupId>
>             <artifactId> toplink-essentials </ artifactId>
>             VERSION 2.0-36 </ version>
>         </ Dependency>
>     </ Dependencies>
>     <repositories>
>         <repository>
>             <id> repository.dev.java.net-maven2 </ id>
>             <name> Java.net repository </ name>
>             <url> http://download.java.net/maven/2 </ url>
>         </ Repository>
>         <repository>
>             <id> OSGeo </ id>
>             <name> Open Source Geospatial Foundation Repository </ name>
>             <url> http://download.osgeo.org/webdav/geotools/ </ url>
>         </ Repository>
>         <repository>
>             <snapshots>
>                 <enabled> true </ enabled>
>             </ Snapshots>
>             <id> opengis </ id>
>             OpenGIS <name> Maven Repository </ name>
>             <url> http://repo.opengeo.org </ url>
>            </ Repository>
>         <repository>
>             <url> http://download.java.net/maven/1 </ url>
>             <id> toplink </ id>
>             <layout> legacy </ layout>
>             <name> Repository for library Library [toplink] </ name>
>         </ Repository>
>     </ Repositories>
>
> </ Project>
>
> Is it wrong that I entered the lake or forgot to enter something
>
> 2011/11/1 Michael Bedward <[email protected]>
>>
>> The maven pom.xml snippet showing which GeoTools modules to include
>> should be fixed on that page now.
>>
>> Michael
>>
>> On 2 November 2011 09:31, Michael Bedward <[email protected]>
>> wrote:
>> > Hello Doeslei,
>> >
>> > Firstly, I've moved your question from the developer list to the user
>> > list. Please subscribe to the user list if you are not already a
>> > member:
>> > http://docs.geotools.org/latest/userguide/welcome/userlistguide.html
>> >
>> >> I was like in this tutorial, but I'm not finding the library
>> >> org.geotools.data.postgis.PostgisNGDataStoreFactory, nor the command
>> >> Map <String, Object> connectionParameters
>> >> wizard.getConnectionParameters =
>> >> ();
>> >> Is there another component I'm missing? or is some library that I
>> >> forgot to
>> >> include? Thanks for the input of all.
>> >
>> > It sounds like you do not have the necessary modules (jars) included.
>> > You mentioned previously that you are using NetBeans but didn't say
>> > whether you are using Maven as your build tool or adding jars manually
>> > to your project. If you are using Maven you need to include both the
>> > gt-jdbc-postgis and gt-swing modules for that tutorial to work.
>> >
>> > Ah !  Looking at that tutorial page it seems that the instructions for
>> > including those modules in your maven pom.xml file have disappeared.
>> > I'll fix that up now.
>> >
>> > In general, with any GeoTools module you can look it up in the user
>> > manual and find out how to specify it in your project. The PostGIS
>> > module page shows the dependency entry which should be in your maven
>> > pom.xml file:
>> >
>> > http://docs.geotools.org/latest/userguide/library/jdbc/postgis.html
>> >
>> > When you are not sure what GeoTools module a class belongs to you can
>> > usually find it listed in the top section of the javadoc page for the
>> > class. For example, the PostGISNGDataStoreFactory page:
>> >
>> >
>> > http://docs.geotools.org/latest/javadocs/org/geotools/data/postgis/PostgisNGDataStoreFactory.html
>> >
>> > lists the following:
>> >
>> > Module:
>> > modules/plugin/jdbc-postgis (gt-jdbc-postgis.jar)
>> >
>> > If you are not using Maven I strongly encourage you to do so because
>> > GeoTools is hard without it and NetBeans has excellent support for
>> > Maven projects.
>> >
>> > Please let us know if this helps.
>> >
>> > Michael
>> >
>
>

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to