title: hibernate stream corrupted exception
body: <p>In a spring mvc application using hibernate, I am getting a <code>could not deserialize</code> error when I change the <code>FetchType</code> to <code>EAGER</code> in a <code>OneToMany</code> relationship between two entities, <code>Encounter</code> and <code>Referral</code>.  The error gets thrown whenever any data-driven url in my app gets called, even though I only changed the <code>FetchType</code> in one relationship.  </p>
  
  <p><strong>Note: Some of the code for this posting has been placed at a file sharing site, which you can access by clicking the links below.</strong>  </p>
  
  <p><strong>Also Note:</strong>  I tried <code>FetchType.Lazy</code>, but that triggers errors relating to <code>failing to lazily initiate... no session</code>.  So I need to use <code>FetchType.EAGER</code>.  </p>
  
  <p>The relevant property definition in <code>Encounter</code> is:  </p>
  
  <pre><code>@OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="encounter")
  private Set&lt;Referral&gt; referrals = new HashSet&lt;Referral&gt;();
  </code></pre>
  
  <p>The entire code for the <code>Encounter</code> entity can be read at a file sharing site <a href="https://jumpshare.com/v/DrViNe8zQoBJAEgNhTE2?b=fM0bVk2zoSI9ocWhhELw" rel="nofollow">by clicking on this link</a>.  </p>
  
  <p>The relevant property definition in <code>Referral</code> is:  </p>
  
  <pre><code>@ManyToOne(fetch=FetchType.EAGER)
  @JoinColumn(name="encounter_id")
  protected Encounter encounter;  
  </code></pre>
  
  <p>The entire code for the <code>Referral</code> entity can be read at a file sharing site <a href="https://jumpshare.com/v/WHRbxVId7r1BmMALOfn8?b=Sj4d4RamLr4U3Ey7AcsP" rel="nofollow">by clicking on this link</a>.  </p>
  
  <p>Here is the complete stack trace:  </p>
  
  <pre><code>Hibernate: select referrals0_.encounter_id as encounte5_11_13_, referrals0_.id as id1_32_13_, referrals0_.id as id1_32_12_, referrals0_.contact_id as contact4_32_12_, referrals0_.scheduled_date as schedule2_32_12_, referrals0_.encounter_id as encounte5_32_12_, referrals0_.office_id as office6_32_12_, referrals0_.patient_id as patient7_32_12_, referrals0_.provider_id as provider8_32_12_, referrals0_.reason as reason3_32_12_, officecont1_.id as id1_17_0_, officecont1_.first_name as first2_17_0_, officecont1_.last_name as last3_17_0_, facilityad2_.id as id1_13_1_, facilityad2_.address as address2_13_1_, facilityad2_.city as city3_13_1_, facilityad2_.company_id as company7_13_1_, facilityad2_.facilityname as facility4_13_1_, facilityad2_.isHQ as isHQ5_13_1_, facilityad2_.type_id as type8_13_1_, facilityad2_.state_id as state9_13_1_, facilityad2_.zip as zip6_13_1_, providerco3_.id as id1_23_2_, providerco3_.name as name2_23_2_, locationty4_.id as id1_16_3_, locationty4_.name as name2_16_3_, state5_.id as id1_33_4_, state5_.name as name2_33_4_, patient6_.id as id1_21_5_, patient6_.first_name as first2_21_5_, patient6_.last_name as last3_21_5_, patient6_.date_of_birth as date4_21_5_, patient6_.ethnic_id as ethnic5_21_5_, patient6_.languagecode as language6_21_5_, patient6_.race_id as race7_21_5_, patient6_.sex_id as sex8_21_5_, ethnicity7_.id as id1_12_6_, ethnicity7_.name as name2_12_6_, language8_.code as code1_15_7_, language8_.name as name2_15_7_, race9_.id as id1_31_8_, race9_.name as name2_31_8_, gender10_.id as id1_14_9_, gender10_.name as name2_14_9_, provider11_.id as id1_30_10_, provider11_.first_name as first2_30_10_, provider11_.last_name as last3_30_10_, provider11_.title_id as title4_30_10_, providerti12_.id as id1_29_11_, providerti12_.name as name2_29_11_ from referrals referrals0_ left outer join officeContacts officecont1_ on referrals0_.contact_id=officecont1_.id left outer join facilityAddresses facilityad2_ on referrals0_.office_id=facilityad2_.id left outer join providerCompanies providerco3_ on facilityad2_.company_id=providerco3_.id left outer join locationTypes locationty4_ on facilityad2_.type_id=locationty4_.id left outer join states state5_ on facilityad2_.state_id=state5_.id left outer join patients patient6_ on referrals0_.patient_id=patient6_.id left outer join ethnicity ethnicity7_ on patient6_.ethnic_id=ethnicity7_.id left outer join languages language8_ on patient6_.languagecode=language8_.code left outer join race race9_ on patient6_.race_id=race9_.id left outer join gender gender10_ on patient6_.sex_id=gender10_.id left outer join providers provider11_ on referrals0_.provider_id=provider11_.id left outer join provider_titles providerti12_ on provider11_.title_id=providerti12_.id where referrals0_.encounter_id=?
  WARN  LoadContexts - HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@48b9e55c&lt;rs=com.mysql.jdbc.JDBC4ResultSet@757583b9&gt;
  WARN  CollectionLoadContext - HHH000160: On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries
  WARN  warn - Handler execution resulted in exception
  org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690) ~[spring-orm-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:106) ~[spring-orm-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403) ~[spring-orm-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.samples.knowledgemanager.util.CallMonitoringAspect.invoke(CallMonitoringAspect.java:80) ~[CallMonitoringAspect.class:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_29]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_29]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
      at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at $Proxy39.findByLastName(Unknown Source) ~[na:na]
      at org.springframework.samples.knowledgemanager.service.ClinicServiceImpl.findPatientByLastName(ClinicServiceImpl.java:104) ~[ClinicServiceImpl.class:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_29]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_29]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
      at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at $Proxy49.findPatientByLastName(Unknown Source) ~[na:na]
      at org.springframework.samples.knowledgemanager.web.PatientController.processFindForm(PatientController.java:78) ~[PatientController.class:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_29]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_29]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
      at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
      at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) ~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) ~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) ~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) ~[spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) [spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) [spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) [spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) [spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) [servlet-api.jar:na]
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) [spring-webmvc-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:na]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
      at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
      at com.github.dandelion.datatables.core.web.filter.DatatablesFilter.doFilter(DatatablesFilter.java:73) [datatables-core-0.9.2.jar:na]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
      at com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter.doFilter(DatatablesFilter.java:71) [datatables-servlet2-0.9.2.jar:na]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.42]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.42]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:7.0.42]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.42]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) [catalina.jar:7.0.42]
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) [catalina.jar:7.0.42]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.42]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [catalina.jar:7.0.42]
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) [tomcat-coyote.jar:7.0.42]
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) [tomcat-coyote.jar:7.0.42]
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) [tomcat-coyote.jar:7.0.42]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_29]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_29]
      at java.lang.Thread.run(Thread.java:662) [na:1.6.0_29]
  Caused by: org.hibernate.type.SerializationException: could not deserialize
      at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:262) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:140) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:121) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:67) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:247) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:332) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2912) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1672) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1604) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.getRow(Loader.java:1504) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:712) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.processResultSet(Loader.java:942) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doQuery(Loader.java:910) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.loadCollection(Loader.java:2234) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1849) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:681) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1030) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:346) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2522) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2508) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2338) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.Loader.list(Loader.java:2333) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:264) ~[hibernate-entitymanager-4.2.1.Final.jar:4.2.1.Final]
      at org.springframework.samples.knowledgemanager.repository.jpa.JpaPatientRepositoryImpl.findByLastName(JpaPatientRepositoryImpl.java:63) ~[JpaPatientRepositoryImpl.class:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_29]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_29]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_29]
      at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) ~[spring-tx-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      ... 77 common frames omitted
  Caused by: java.io.StreamCorruptedException: invalid stream header: 32303134
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782) ~[na:1.6.0_29]
      at java.io.ObjectInputStream.&lt;init&gt;(ObjectInputStream.java:279) ~[na:1.6.0_29]
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:328) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:318) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final]
      ... 123 common frames omitted  
  </code></pre>