Hi Sebastien,
On 07 Jan 2008, at 18:44, Sebastien ARBOGAST wrote:
> When I try to load points from a PostGIS database, I get the following
> exception:
>
> Caused by: java.lang.ClassCastException: org.postgresql.util.PGobject
> at org.hibernatespatial.postgis.PGGeometryUserType.convert2JTS
> (PGGeometryUserType.java:75)
> at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet
> (AbstractDBGeometryType.java:123)
> at org.hibernatespatial.GeometryUserType.nullSafeGet
> (GeometryUserType.java:169)
>
What versions of the postgresql/postgis drivers are you using?
> I would have liked to debug hibernate-spatial code to see what's wrong
> inside, but I couldn't find the specific source corresponding to the
> latest release.
>
> And I tried to check out the latest sources but I couldn't build it
> because of missing dependencies.
The easiest way to build Hibernate Spatial is to check out all
projects from the subversion repository.
> svn checkout
https://intra.geovise.com/svn/hibernate-spatial/trunk
hibernate-spatial
then move to the hibernate-spatial/hibernate-spatial-maven directory
and run
> mvn package (or mvn install)
This will resolve all dependencies, download the necessary jars,
compile everything and build the jars.
Unfortunately, maven won't be able to get some jars automatically
using the standard JTS configuration. Try adding the following to the
maven settings.xml in the <repositories> settings (see the maven
documentation about this).
<repository>
<id>geotools</id>
<name>GeoTools repo</name>
<url>
http://www.geotools.fr/repository</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
This will allow maven to get most postgis and jts libraries from a
public maven repository.
The Oracle and JTA drivers must be downloaded and installed manually
in the maven repository. If you run 'mvn package' without having
installed these libraries, it will inform you on how to install them.
After that everything should install fine.
Btw, I think this particular problem has been resolved in the trunk
version.
Regards,
Karel Maesen
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users