not recognized spatial column

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

not recognized spatial column

orkun
hello

Despite all my efforts, I could not get spatial data from postgis2.0.1
to spring-jpa2

I tried my application excluding spatial column and  it worked.

But when I include spatial column, I get exceptions.

Although I tried various postgresql/postgis - jdbc drivers in my
classpath. It failed.

here is the pojo:
@Column(columnDefinition = "Geometry", nullable = true)
@Type(type = "org.hibernate.spatial.GeometryType")
    private Geometry geom;

~~~~~~~~~~~~~

here is the part of spring configuration:

                        <props>
                        <prop key="hibernate.dialect">org.hibernate.spatial.dialect.postgis.PostgisDialect</prop>
                                <prop key="hibernate.max_fetch_depth">5</prop>
                                <prop key="hibernate.jdbc.fetch_size">50</prop>
                                <prop key="hibernate.jdbc.batch_size">10</prop>
                                <prop key="hibernate.show_sql">true</prop>
                                <prop key="hibernate.format_sql">true</prop>
                                <prop key="hibernate.format_sql"> value </prop>
                                <prop key="hibernate.hibernate.hbm2ddl.auto">update</prop>
                               
                        <!--   <prop key="hibernate.temp.use_jdbc_metadata_defaults">false
</prop>  -->

                        </props>
~~~~~~~~~~~~

here are the exceptions I get:


2012-10-16 14:32:21,081 INFO [org.hibernate.impl.SessionFactoryImpl] -
<building session factory>
2012-10-16 14:32:21,087 INFO [org.hibernate.type.BasicTypeRegistry] -
<Type registration [materialized_blob] overrides previous :
org.hibernate.type.MaterializedBlobType@5585dc>
2012-10-16 14:32:21,261 INFO
[org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding
factory to JNDI, no JNDI name configured>
Hibernate: select contact0_.ID as ID3_, contact0_.FIRSTNAME as
FIRSTNAME3_, contact0_.geom as geom3_, contact0_.LASTNAME as
LASTNAME3_ from contact contact0_
Exception in thread "main" javax.persistence.PersistenceException:
org.hibernate.type.SerializationException: could not deserialize
~~~~~~~~~~~~~~~~~~~

I will appreciate if you supply hints.

regards
--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı

Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: not recognized spatial column

Jan Boonen
Hi Ahmet,

I have seen this error now and then. Usually it occurs if you have a
classpath conflict. Please check your application server and web
application archive and see if you don't have duplicate files there.

Cheers,

Jan

On 16-10-2012 13:46, Ahmet Temiz wrote:

> hello
>
> Despite all my efforts, I could not get spatial data from postgis2.0.1
> to spring-jpa2
>
> I tried my application excluding spatial column and  it worked.
>
> But when I include spatial column, I get exceptions.
>
> Although I tried various postgresql/postgis - jdbc drivers in my
> classpath. It failed.
>
> here is the pojo:
> @Column(columnDefinition = "Geometry", nullable = true)
> @Type(type = "org.hibernate.spatial.GeometryType")
>      private Geometry geom;
>
> ~~~~~~~~~~~~~
>
> here is the part of spring configuration:
>
> <props>
> <prop key="hibernate.dialect">org.hibernate.spatial.dialect.postgis.PostgisDialect</prop>
> <prop key="hibernate.max_fetch_depth">5</prop>
> <prop key="hibernate.jdbc.fetch_size">50</prop>
> <prop key="hibernate.jdbc.batch_size">10</prop>
> <prop key="hibernate.show_sql">true</prop>
> <prop key="hibernate.format_sql">true</prop>
> <prop key="hibernate.format_sql"> value </prop>
> <prop key="hibernate.hibernate.hbm2ddl.auto">update</prop>
>
> <!--   <prop key="hibernate.temp.use_jdbc_metadata_defaults">false
> </prop>  -->
>
> </props>
> ~~~~~~~~~~~~
>
> here are the exceptions I get:
>
>
> 2012-10-16 14:32:21,081 INFO [org.hibernate.impl.SessionFactoryImpl] -
> <building session factory>
> 2012-10-16 14:32:21,087 INFO [org.hibernate.type.BasicTypeRegistry] -
> <Type registration [materialized_blob] overrides previous :
> org.hibernate.type.MaterializedBlobType@5585dc>
> 2012-10-16 14:32:21,261 INFO
> [org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding
> factory to JNDI, no JNDI name configured>
> Hibernate: select contact0_.ID as ID3_, contact0_.FIRSTNAME as
> FIRSTNAME3_, contact0_.geom as geom3_, contact0_.LASTNAME as
> LASTNAME3_ from contact contact0_
> Exception in thread "main" javax.persistence.PersistenceException:
> org.hibernate.type.SerializationException: could not deserialize
> ~~~~~~~~~~~~~~~~~~~
>
> I will appreciate if you supply hints.
>
> regards


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users