java异常总结---1.java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.support.OpenSessio

技术qq交流群:JavaDream:251572072

1.java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
a.OpenSessionInViewFilter先明白这个类:
  OpenSessionInViewFilter是Spring提供的一个针对Hibernate的一个支持类,
  其主要意思是在发起一个页面请求时打开Hibernate的Session,一直保持这个Session,
  直到这个请求结束,具体是通过一个Filter来实现的。  
  由于Hibernate引入了Lazy Load特性,使得脱离Hibernate的Session周期的对象如果再想通过getter方法取到其关联对象的值,
  Hibernate会抛出一个LazyLoad的Exception。所以为了解决这个问题,
  Spring引入了这个Filter,使得Hibernate的Session的生命周期变长。
-------------------------------------------------------------------------
b.解决方法:
  在Spring与Hibernate集成时在web.xml要加入这样的过滤器:
 <filter>
 <filter-name>openSessionInView</filter-name>
 <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
 <init-param>
 <param-name>sessionFactoryBeanName</param-name>
 <param-value>sessionFactory</param-value>
 </init-param>
 </filter>

<filter-mapping>
 <filter-name>openSessionInView</filter-name>
 <url-pattern>/*</url-pattern>
 </filter-mapping>
 ---------------------------------
 orm.hibernate3.support.OpenSessionInViewFilter
 这里查看这个是不是写成了
  orm.hibernate4.support.OpenSessionInViewFilter
---------------------------------------------

java异常总结---1.java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.support.OpenSessio相关推荐

  1. spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet

    spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet 情况1: ...

  2. 异常解决java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics

    异常java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics 原因:sprin ...

  3. java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL,spring获取context...

    今天学习spring项目的时候出现了下面的错误信息: java.lang.ClassNotFoundException: org.springframework.web.context.Context ...

  4. SSM中抛出异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoad

    问题产生背景 最初搭建时的Spring框架版本是: <dependency><groupId>org.springframework</groupId><ar ...

  5. tomcat java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListen

    真正解决问题:maven eclipse tomcat java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...

  6. springBoot启动失败Caused by: java.lang.ClassNotFoundException: org.springframework.http.MediaType

    异常详情: Error starting ApplicationContext. To display the conditions report re-run your application wi ...

  7. Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Bootstrapper导致原因

    最近在写项目时,采用renren-fast后端,启动时,报了org.springframework.boot.Bootstrapper一个异常,网上查阅信息,确实是Spring Boot 依赖版本和S ...

  8. 真正解决问题:maven eclipse tomcat java.lang.ClassNotFoundException: org.springframework.web.context.Contex

    在使用eclipse进行整合springmvc时经常会碰到这样的异常: java.lang.ClassNotFoundException:org.springframework.web.context ...

  9. java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext

    07-Jun-2021 12:40:51.923 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseMod ...

最新文章

  1. 例题3-6 环状序列(Circular Sequence, ACM/ICPC Seoul 2004, UVa1584)
  2. opencv-视频处理-实时的前景检测-Vibe算法
  3. java中延迟_Java中的延迟分配
  4. python函数对变量的作用_python函数对变量的作用及遵循的原则
  5. 对标小米!华为P50 Pro+将有望搭载液态镜头技术
  6. Filecoin网络目前总质押量约为2930万枚FIL
  7. 分享一些Java常见的面试题,大厂都爱用
  8. saltstack 快速入门
  9. 集合数组集合ArrayList
  10. GOM引擎版本为什么玩家会自动掉线或闪退?
  11. 【opencart3源码分析】货币类currency.php
  12. python 相关性fdr矫正_你的p值,进行FDR校正了吗?
  13. 电脑连接上WiFi但是上不了网
  14. h.265/HEVC解码器verilog实现
  15. python调用函数实现银行ATM典型案例练习
  16. python 均线斜率怎么计算_高频交易算法研发心得--均线算法
  17. SQL笔记——嵌套查询
  18. 什么是SPOOLing?
  19. slf4j配置与解析
  20. unity文字逐个出现实现文字打印机效果-Text

热门文章

  1. HDU-1233-还是畅通工程(最小生成树)
  2. Python四:HoughCircles()霍夫变换
  3. Modules:PETCTFusion-Documentation-3.6
  4. MyBatis中selectByExample和selectByExampleWithBLOBs区别
  5. 全方位打造最强终端(iterm2 + oh my zsh)
  6. 洛谷 P1074 靶形数独 Label:search 不会
  7. 从 A/Looper: Could not create epoll instance. errno=24 错误浅谈解决各种 bug 的思路
  8. Android Studio 使用笔记:快捷键
  9. 学习面向对象思想,开始考虑通过封装、 继承、多态把程序的耦合度降低
  10. Shell Script 学习一