Troubleshooting new configuration (invalid stream header exception)

2 messages Options
Embed this post
Permalink
Ted Scott

Troubleshooting new configuration (invalid stream header exception)

Reply Threaded More More options
Print post
Permalink
I have a first time install using hibernate annotations and am getting
"could not read column value from result set: geom1_; could not
deserialize" followed by an invalid stream header exception.

Does anyone have any clues that will help me troubleshoot this? My
application is running under glassfish, using spring to configure
hibernate. The jars I'm using are:
hibernate-3.2.2.ga.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-core-3.3.1.GA.jar
hibernate-spatial-1.0-M2.jar
hibernate-spatial-postgis-1.0-M2.jar

I'm set up as per the tutorial
(http://www.hibernatespatial.org/tutorial.html) I have added the
@Type(type="org.hibernatespatial.GeometryUserType")
Annotation to my DAO, I am using the PostgisDialect. It all works well
as long as I don't try to get spatial data from the DB. It's almost like
the GeometryUserType is being ignored.

The spring hibernate configuration is:
<!-- Hibernate SessionFactory wired to the JNDI DB lookup-->
     <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
         <property name="dataSource" ref="dataSource"></property>
         <property name="annotatedClasses">
             <list>
                 <value>gov.faa.aim.domain.MOTD</value>
                 <value>gov.faa.aim.domain.ScheduleLine</value>
             </list>
         </property>
         <property name="hibernateProperties">
             <props>
                 <prop key="hibernate.show_sql">true</prop>
                 <prop
key="hibernate.dialect">org.hibernatespatial.postgis.PostgisDialect</prop>
             </props>
         </property>
     </bean>

Again I'm looking for some clues to help troubleshoot this, how can I
get more detailed debuggery in the log? Have I missed something
incredily obvious?


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

solved Re: Troubleshooting new configuration (invalid stream header exception)

Reply Threaded More More options
Print post
Permalink
If anyone can shed some light on why this behavior exists, it will
deepen my understanding of hibernate.

Turns out that I had some annotations before the get/set methods and
then placed the @Type annotation before the class variable geom. Moving
@Type to the methods cleared the stream problem. I haven't tried placing
all the annotations before the class variables, but I suspect it will
work that way as long as they are not mixed.

FWIW,
-Ted

Ted Scott wrote:

> I have a first time install using hibernate annotations and am getting
> "could not read column value from result set: geom1_; could not
> deserialize" followed by an invalid stream header exception.
>
> Does anyone have any clues that will help me troubleshoot this? My
> application is running under glassfish, using spring to configure
> hibernate. The jars I'm using are:
> hibernate-3.2.2.ga.jar
> hibernate-annotations-3.4.0.GA.jar
> hibernate-commons-annotations-3.1.0.GA.jar
> hibernate-core-3.3.1.GA.jar
> hibernate-spatial-1.0-M2.jar
> hibernate-spatial-postgis-1.0-M2.jar
>
> I'm set up as per the tutorial
> (http://www.hibernatespatial.org/tutorial.html) I have added the
> @Type(type="org.hibernatespatial.GeometryUserType")
> Annotation to my DAO, I am using the PostgisDialect. It all works well
> as long as I don't try to get spatial data from the DB. It's almost like
> the GeometryUserType is being ignored.
>
> The spring hibernate configuration is:
> <!-- Hibernate SessionFactory wired to the JNDI DB lookup-->
>      <bean id="sessionFactory"
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>          <property name="dataSource" ref="dataSource"></property>
>          <property name="annotatedClasses">
>              <list>
>                  <value>gov.faa.aim.domain.MOTD</value>
>                  <value>gov.faa.aim.domain.ScheduleLine</value>
>              </list>
>          </property>
>          <property name="hibernateProperties">
>              <props>
>                  <prop key="hibernate.show_sql">true</prop>
>                  <prop
> key="hibernate.dialect">org.hibernatespatial.postgis.PostgisDialect</prop>
>              </props>
>          </property>
>      </bean>
>
> Again I'm looking for some clues to help troubleshoot this, how can I
> get more detailed debuggery in the log? Have I missed something
> incredily obvious?
>
>
> -Ted
> _______________________________________________
> 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