java异常总结---1.java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.support.OpenSessio
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相关推荐
- spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet
spring异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderServlet 情况1: ...
- 异常解决java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics
异常java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.PublicMetrics 原因:sprin ...
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL,spring获取context...
今天学习spring项目的时候出现了下面的错误信息: java.lang.ClassNotFoundException: org.springframework.web.context.Context ...
- SSM中抛出异常 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoad
问题产生背景 最初搭建时的Spring框架版本是: <dependency><groupId>org.springframework</groupId><ar ...
- tomcat java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListen
真正解决问题:maven eclipse tomcat java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...
- springBoot启动失败Caused by: java.lang.ClassNotFoundException: org.springframework.http.MediaType
异常详情: Error starting ApplicationContext. To display the conditions report re-run your application wi ...
- Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Bootstrapper导致原因
最近在写项目时,采用renren-fast后端,启动时,报了org.springframework.boot.Bootstrapper一个异常,网上查阅信息,确实是Spring Boot 依赖版本和S ...
- 真正解决问题:maven eclipse tomcat java.lang.ClassNotFoundException: org.springframework.web.context.Contex
在使用eclipse进行整合springmvc时经常会碰到这样的异常: java.lang.ClassNotFoundException:org.springframework.web.context ...
- 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 ...
最新文章
- 例题3-6 环状序列(Circular Sequence, ACM/ICPC Seoul 2004, UVa1584)
- opencv-视频处理-实时的前景检测-Vibe算法
- java中延迟_Java中的延迟分配
- python函数对变量的作用_python函数对变量的作用及遵循的原则
- 对标小米!华为P50 Pro+将有望搭载液态镜头技术
- Filecoin网络目前总质押量约为2930万枚FIL
- 分享一些Java常见的面试题,大厂都爱用
- saltstack 快速入门
- 集合数组集合ArrayList
- GOM引擎版本为什么玩家会自动掉线或闪退?
- 【opencart3源码分析】货币类currency.php
- python 相关性fdr矫正_你的p值,进行FDR校正了吗?
- 电脑连接上WiFi但是上不了网
- h.265/HEVC解码器verilog实现
- python调用函数实现银行ATM典型案例练习
- python 均线斜率怎么计算_高频交易算法研发心得--均线算法
- SQL笔记——嵌套查询
- 什么是SPOOLing?
- slf4j配置与解析
- unity文字逐个出现实现文字打印机效果-Text
热门文章
- HDU-1233-还是畅通工程(最小生成树)
- Python四:HoughCircles()霍夫变换
- Modules:PETCTFusion-Documentation-3.6
- MyBatis中selectByExample和selectByExampleWithBLOBs区别
- 全方位打造最强终端(iterm2 + oh my zsh)
- 洛谷 P1074 靶形数独 Label:search 不会
- 从 A/Looper: Could not create epoll instance. errno=24 错误浅谈解决各种 bug 的思路
- Android Studio 使用笔记:快捷键
- 学习面向对象思想,开始考虑通过封装、 继承、多态把程序的耦合度降低
- Shell Script 学习一