This problem has indeed been around for many years. As Jody said, just exclude the version that Hibernate Spatial is using, and use the one GeoTools requires.

Jody Garnett schreef:
Actually that is expected - and why maven offers the exclude facility.

It should actually work if both projects depended on the exact same version of 
the jdbc driver. You should also note that you are introducing risk by using 
one of the projects with a version of the jdbc driver it is untested with.

You can work around this problem using classloaders - indeed that is what they 
are for.

Jody

On 10/03/2010, at 11:41 PM, Stefan Krüger wrote:

Hi Geotoolers
Hi Karel

I just stumbled over a problem i wanted to report. In a maven project i defined the dependencies for gt-postgis and hibernate-spatial. But when used together, i got "unknown type" errors when mapping a Geometry column. (=> hibernate-
spatial didn't work)

It showed that the problem are two different artifacts both containing the same postgis JDBC driver.

Geotools 2.6 pulls in this one:
http://download.osgeo.org/webdav/geotools/org/geotools/gt-postgis/2.6.2/gt-
postgis-2.6.2.pom
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-driver</artifactId>
−
<!--
The version number is specified in the parent POM.
-->
</dependency>
Hibernate-Spatial pulls in this one:
http://www.hibernatespatial.org/repository/org/hibernatespatial/hibernate-
spatial-postgis/1.0-SNAPSHOT/hibernate-spatial-
postgis-1.0-20080125.203609-2.pom       
                <dependency>
                        <groupId>org.postgis</groupId>
                        <artifactId>postgis-jdbc</artifactId>
                        <version>1.1.6</version>
                </dependency>
I solved the problem telling my gt-postgis dependency to exclude its postgis dependency and now all works fine.
   <dependency>
                       <groupId>org.geotools</groupId>
                       <artifactId>gt-postgis</artifactId>
                       <version>${geotools.version}</version>
                       <type>jar</type>
                       <scope>compile</scope>

                       <exclusions>
                               <exclusion>  <groupId>org.postgis</groupId>
<artifactId>postgis-driver</artifactId> </exclusion>
                       </exclusions>

               </dependency>
I just thought i mail this to hibernate-spatial and geotools developers so maybe one can become more compatibel to the other.

Greetings
Steve

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

--
Pieter De Graef

Community Manager
GeoSparc nv.
http://www.geosparc.com/

Chairman of the Geomajas project
http://www.geomajas.org/


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to