Problems starting with Hibernate Spatial

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problems starting with Hibernate Spatial

assaf8884
Hi,
I have read the tutorial on how to start working with Hibernate Spatial but it is not playing well..
i am working with Maven - Spring  - Hibernate - MySql , related artifacts i am using in my pom.xml

<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.11</version>
</dependency>

<dependency>
<groupId>org.hibernatespatial</groupId>
<artifactId>hibernate-spatial-mysql</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.1.Final</version>
</dependency>



I am using org.hibernatespatial.mysql.MySQLSpatialDialect as the db dialect.

and i have a domain entity which contain the blow..
@Basic
@Column(name="LOC")
@Type(type="org.hibernatespatial.GeometryUserType")
private Point loc;

in my persistence.xml i have a the property <property name="hibernate.hbm2ddl.auto" value="create-drop"/>

when i start the application i getting the following exception...

Caused by: java.lang.NoSuchFieldError: INTEGER
        at org.hibernatespatial.mysql.MySQLSpatialDialect.getFunctionsToRegister(MySQLSpatialDialect.java:75)
        at org.hibernatespatial.mysql.MySQLSpatialDialect.<init>(MySQLSpatialDialect.java:134)
        at org.hibernatespatial.mysql.DialectProvider.getDefaultDialect(DialectProvider.java:66)
        at org.hibernatespatial.HBSpatialExtension.forceConfigure(HBSpatialExtension.java:159)
        at org.hibernatespatial.HBSpatialExtension.configure(HBSpatialExtension.java:151)
        at org.hibernatespatial.HBSpatialExtension.getDefaultSpatialDialect(HBSpatialExtension.java:200)
        at org.hibernatespatial.GeometryUserType.configure(GeometryUserType.java:65)
        at org.hibernatespatial.GeometryUserType.initialize(GeometryUserType.java:82)
        at org.hibernatespatial.GeometryUserType.sqlTypes(GeometryUserType.java:233)
        at org.hibernate.type.CustomType.<init>(CustomType.java:73)
        at org.hibernate.type.CustomType.<init>(CustomType.java:67)
        at org.hibernatespatial.GeometryUserType.<clinit>(GeometryUserType.java:61)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at org.hibernate.type.TypeFactory.custom(TypeFactory.java:188)
        at org.hibernate.type.TypeFactory.custom(TypeFactory.java:179)
        at org.hibernate.type.TypeFactory.byClass(TypeFactory.java:103)
        at org.hibernate.type.TypeResolver.heuristicType(TypeResolver.java:130)
        at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:295)
        at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:288)
        at org.hibernate.mapping.Property.isValid(Property.java:216)



can someone tell me what am i doing wrong?