在ssh4中的sessionFactory配置文件中應將hibernate.current_session_context_class設爲org.springframework.orm.hibernate3.SpringSessionContext(默認爲此值),並應用spring管理事務。
如果爲<prop key="hibernate.current_session_context_class">thread</prop> 則會報該異常。
解決方案:
將 <prop key="hibernate.current_session_context_class">thread</prop> 刪除,
或者改爲默認值:org.springframework.orm.hibernate3.SpringSessionContext