exception - disabling contexual lob creation

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

exception - disabling contexual lob creation

orkun
hello

I am using:

postgresql 9.1beta1
postgis 2.0
hib-spat 4.0
spring 3.0
jpa2

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

//getter and setter

I am getting this exception:
disabling contexual lob creation as createclob()

what are possible wrong ?

kind 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: exception - disabling contexual lob creation

Karel Maesen
Administrator
Hi,

I haven't tested HS 4 with Postgis 2.0, but I don't expect any problems.  

You seem to have some problems getting everything to work. Most issues (from your previous post) seem to be related to your spring/hibernate/JPA configuration, rather than with Hibernate Spatial per se. I would advise you to first get a non-spatial application set-up working, and later add the Hibernate Spatial stuff. That will make it easier to determine what causes the problems.

Also, if you mention an exception, be sure to include the complete stacktrace. Without a stacktrace it is impossible to understand where the exceptions originate.

Regards,

Karel Maesen


On 07 Oct 2012, at 19:10, Ahmet Temiz wrote:

> hello
>
> I am using:
>
> postgresql 9.1beta1
> postgis 2.0
> hib-spat 4.0
> spring 3.0
> jpa2
>
> @Column(columnDefinition = "Geometry", nullable = true)
> @Type(type = "org.hibernate.spatial.GeometryType")
>    private Geometry geom;
>
> //getter and setter
>
> I am getting this exception:
> disabling contexual lob creation as createclob()
>
> what are possible wrong ?
>
> kind 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

_______________________________________________
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: exception - disabling contexual lob creation

orkun
Thank you


When I exclude spatial column from select, no problem appears.

which is:

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

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

when I include spatial column, I get these exceptions:

2012-10-11 19:59:12,991 INFO [org.hibernate.type.BasicTypeRegistry] -
<Type registration [materialized_blob] overrides previous :
org.hibernate.type.MaterializedBlobType@523be>
2012-10-11 19:59:13,150 INFO
[org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding
factory to JNDI, no JNDI name configured>
Hibernate: select contact0_.ID as ID3_, contact0_.FIRST_NAME as
FIRST2_3_, contact0_.geom as geom3_, contact0_.LAST_NAME as LAST4_3_
from contact contact0_
Exception in thread "main" javax.persistence.PersistenceException:
org.hibernate.type.SerializationException: could not deserialize
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1315)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:255)
        at com.apress.prospring3.ch10.service.jpa.ContactServiceImpl.findAll(ContactServiceImpl.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy34.findAll(Unknown Source)
        at com.apress.prospring3.ch10.JpaSample.main(JpaSample.java:41)
Caused by: org.hibernate.type.SerializationException: could not deserialize
        at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
        at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:306)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:130)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:116)
        at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:39)
        at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:62)
        at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230)
        at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:331)
        at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
        at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
        at org.hibernate.loader.Loader.getRow(Loader.java:1355)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
        at org.hibernate.loader.Loader.doQuery(Loader.java:829)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
        at org.hibernate.loader.Loader.doList(Loader.java:2542)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
        at org.hibernate.loader.Loader.list(Loader.java:2271)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
        ... 13 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 30313031
        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)
        at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
        at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
        at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
        ... 39 more

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

what are the possible reasons ?

regards


On Tue, Oct 9, 2012 at 10:40 PM, Karel Maesen <[hidden email]> wrote:

> Hi,
>
> I haven't tested HS 4 with Postgis 2.0, but I don't expect any problems.
>
> You seem to have some problems getting everything to work. Most issues (from your previous post) seem to be related to your spring/hibernate/JPA configuration, rather than with Hibernate Spatial per se. I would advise you to first get a non-spatial application set-up working, and later add the Hibernate Spatial stuff. That will make it easier to determine what causes the problems.
>
> Also, if you mention an exception, be sure to include the complete stacktrace. Without a stacktrace it is impossible to understand where the exceptions originate.
>
> Regards,
>
> Karel Maesen
>
>
> On 07 Oct 2012, at 19:10, Ahmet Temiz wrote:
>
>> hello
>>
>> I am using:
>>
>> postgresql 9.1beta1
>> postgis 2.0
>> hib-spat 4.0
>> spring 3.0
>> jpa2
>>
>> @Column(columnDefinition = "Geometry", nullable = true)
>> @Type(type = "org.hibernate.spatial.GeometryType")
>>    private Geometry geom;
>>
>> //getter and setter
>>
>> I am getting this exception:
>> disabling contexual lob creation as createclob()
>>
>> what are possible wrong ?
>>
>> kind 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
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



--
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: exception - disabling contexual lob creation

Karel Maesen
Administrator
Hi Ahmet,

From the stacktrace I can see that Hibernate fails to map the geom property to a GeometryType, despite the annotation. It seems to treat the 'geom' property as a  VARBINARY and (unsurprisingly) fails to deserialize the value.

The most likely explanation is that Hibernate uses the standard Postgresql dialect, and not the PostgisDialect. Check in the logs for something like "HHH000400 Using dialect: org.hibernate.spatial.dialect.postgis.PostgisDialect" (log-level INFO, and logged during creation of the EntityManagerFactory.

Here you can find an example of using HS 4 and JPA (no Spring though): https://github.com/maesenka/hibernate-spatial-tutorials

Regards,

Karel



On 11 Oct 2012, at 19:08, Ahmet Temiz wrote:

> Thank you
>
>
> When I exclude spatial column from select, no problem appears.
>
> which is:
>
> @Column(columnDefinition = "Geometry", nullable = true)
> @Type(type = "org.hibernate.spatial.GeometryType")
> private Geometry geom;
>
> ~~~~~~~~~~~~~~~~
>
> when I include spatial column, I get these exceptions:
>
> 2012-10-11 19:59:12,991 INFO [org.hibernate.type.BasicTypeRegistry] -
> <Type registration [materialized_blob] overrides previous :
> org.hibernate.type.MaterializedBlobType@523be>
> 2012-10-11 19:59:13,150 INFO
> [org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding
> factory to JNDI, no JNDI name configured>
> Hibernate: select contact0_.ID as ID3_, contact0_.FIRST_NAME as
> FIRST2_3_, contact0_.geom as geom3_, contact0_.LAST_NAME as LAST4_3_
> from contact contact0_
> Exception in thread "main" javax.persistence.PersistenceException:
> org.hibernate.type.SerializationException: could not deserialize
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1315)
> at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:255)
> at com.apress.prospring3.ch10.service.jpa.ContactServiceImpl.findAll(ContactServiceImpl.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy34.findAll(Unknown Source)
> at com.apress.prospring3.ch10.JpaSample.main(JpaSample.java:41)
> Caused by: org.hibernate.type.SerializationException: could not deserialize
> at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
> at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:306)
> at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:130)
> at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:116)
> at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:39)
> at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:62)
> at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
> at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254)
> at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250)
> at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230)
> at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:331)
> at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
> at org.hibernate.loader.Loader.doList(Loader.java:2542)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
> at org.hibernate.loader.Loader.list(Loader.java:2271)
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
> at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
> at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
> at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
> ... 13 more
> Caused by: java.io.StreamCorruptedException: invalid stream header: 30313031
> at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)
> at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
> at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
> at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
> ... 39 more
>
> ~~~~~~~~~~~~
>
> what are the possible reasons ?
>
> regards
>
>
> On Tue, Oct 9, 2012 at 10:40 PM, Karel Maesen <[hidden email]> wrote:
>> Hi,
>>
>> I haven't tested HS 4 with Postgis 2.0, but I don't expect any problems.
>>
>> You seem to have some problems getting everything to work. Most issues (from your previous post) seem to be related to your spring/hibernate/JPA configuration, rather than with Hibernate Spatial per se. I would advise you to first get a non-spatial application set-up working, and later add the Hibernate Spatial stuff. That will make it easier to determine what causes the problems.
>>
>> Also, if you mention an exception, be sure to include the complete stacktrace. Without a stacktrace it is impossible to understand where the exceptions originate.
>>
>> Regards,
>>
>> Karel Maesen
>>
>>
>> On 07 Oct 2012, at 19:10, Ahmet Temiz wrote:
>>
>>> hello
>>>
>>> I am using:
>>>
>>> postgresql 9.1beta1
>>> postgis 2.0
>>> hib-spat 4.0
>>> spring 3.0
>>> jpa2
>>>
>>> @Column(columnDefinition = "Geometry", nullable = true)
>>> @Type(type = "org.hibernate.spatial.GeometryType")
>>>   private Geometry geom;
>>>
>>> //getter and setter
>>>
>>> I am getting this exception:
>>> disabling contexual lob creation as createclob()
>>>
>>> what are possible wrong ?
>>>
>>> kind 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
>>
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
>
> --
> 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

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