Hil,
I'm trying to use the hibernate spatial in my project, but I have same issues,
I'm working with jboss 4.2.3, jboss-seam 2.0.3, postgresql 8.3
I get this error when I start my jboss:
Code:
08:50:33,984 ERROR [[/Sigpn]] Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: SigpnEntityManagerFactory
at org.jboss.seam.Component.newInstance(Component.java:1986)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
at org.jboss.seam.init.Initialization.init(Initialization.java:596)
...................
Caused by: org.hibernate.MappingException: Could not determine type for: org.hibernatespatial.GeometryUserType, for columns: [org.hibernate.mapping.Column(gpoly)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
My entity .java is:
Code:
public class OccupationSol implements java.io.Serializable {
private MultiPolygon gpoly;
@Column(name = "gpoly", columnDefinition="GEOMETRY" )
@Type(type="org.hibernatespatial.GeometryUserType")
public MultiPolygon getGpoly() {
return gpoly;
}
public void setGpoly(MultiPolygon gpoly) {
this.gpoly = gpoly;
}
}
this is my persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="Sigpn" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/SigpnDatasource</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernatespatial.postgis.PostgisDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
And I have this Jars into my WEB-INF/lib:
Hibernatre-spatial-1.0-M2.jar
Hibernatre-spatial-postgis-1.0-M2.jar
Hibernate3.jar
postgis-1.4.jar
postgresql-8.3-604.jdbc4.jar
jts-1.8.jar
jtsio-1.8.jar
I really don't know how to solve this error, Can you help me, thx