Spring报错——Scope 'session' is not active for the current thread
在对程序进行了一些修改后,运行发现spring报了这个错误,这是由于我设置了一个@Scope("session")导致的,现记录下解决方法。
解决方法:
将Scope设置为scope="session"需要在web.xml中做一下设置打开session机制:
<!-- 开启Session机制 -->
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
如果单单加入以上一条还不行的话,那就在相应的spring bean配置中加入<aop:scoped-proxy/>,如:
<bean id="xxxx" class="xxx" scope="session">
<aop:scoped-proxy/>
</bean>
Spring报错——Scope 'session' is not active for the current thread的更多相关文章
- Scope 'request' is not active for the current thread
Unable to instantiate Action, getUserAction, defined for 'getUser' in namespace '/'Error creating be ...
- git pull报错:There is no tracking information for the current branch
报错: There is no tracking information for the current branch. Please specify which branch you want to ...
- 部署CM集群首次运行报错:Formatting the name directories of the current NameNode.
1. 报错提示 Formatting the name directories of the current NameNode. If the name directories are not emp ...
- git 报错 gitThere is no tracking information for the current branch. Please specify which branch you w
新建本地分支后将本地分支推送到远程库, 使用git pull 或者 git push 的时候报错gitThere is no tracking information for the current ...
- Spring+Hibernate4 Junit 报错No Session found for current thread
论坛上有另外一篇更全面的帖子,jinnianshilongnian写的:http://www.iteye.com/topic/1120924 本文的环境是: spring-framework-3.1 ...
- spring报错NoClassDefFoundError等与第三方jar包导入问题
今天配置spring,遇到各种报错的问题,做一个小小总结. 1.刚开始我忘了引入commons-logging,报错.--解决方式:下载并引入该jar包 2.spring以及commons-loggi ...
- spring 报错
一. java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter 解决方案: 1. ...
- .NET CORE 使用Session报错:Session has not been configured for this application or request
报错信息:Session has not been configured for this application or request 解决方案:在Startup.cs文件中的Configure方法 ...
- 报错解决——xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
一般在遇到这个问题的时候都是想用git或者svn,结果发现用不了并报错xcrun: error: invalid active developer path (/Library/Developer/C ...
随机推荐
- HDU4496(并查集)
D-City Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Subm ...
- [html5] 学习笔记-Canvas 绘制渐变图形与绘制变形图形
在 HTML5 中,使用 Canvas API 绘制图形的知识,可以对绘制图形进行处理,包含使用 Canvas API 绘制渐变图形,使用 Canvas API 的坐标轴变换处理功能绘制变形图形.其中 ...
- IOS控件布局之Masonry布局框架
前言: 回想起2013年做iOS开发的时候,那时候并没有采用手写布局代码的方式,而是采用xib文件来编写,如果使用纯代码方式是基于window的size(320,480)计算出一个相对位置进行布局,那 ...
- java_JDBC(2)
1.Statement 每次执行sql语句,数据库都要执行sql语句的编译 ,最好用于仅执行一次查询并返回结果的情形,效率高于PreparedStatement. 2.PreparedStatemen ...
- GIS制图课程前言
一直以来都想写一本关于电子地图制图的工具书,把过去所遇到的关于电子地图制图的种种方法.技巧和问题进行总结和归纳,传播电子地图制图的思路和心得. 从2010年开始,陆陆续续在华南地区开展了多场的电子地图 ...
- std::list 源代码解析
首先声明,下面的讲解都是针对GCC2.9,std::alloc 通过下面的源代码大家可以看到list类的内部成员是一个node,而他的类型是linktype,前面的typedef里面有介绍是一个指针, ...
- 一个普通底层.NET程序员关于职场瓶颈期的思考,辗转自我提升/跳槽/转行之间
徒有工龄,没技术没学历没平台没家底,工作几年,无车无房无存款还前景不明. 时常有身边的亲友问怎么学开发怎么转互联网,说起IT行业都说工资高,动辄月薪上万动辄年薪几十万. 再看看自己,我可能是假的程序员 ...
- 华为荣耀畅玩5C NEM-UL10 ROOT那些事儿(亲测成功)
以前ROOT手机都是在手机上安装KingRoot 刷机精灵等软件分分钟成功(不排除偶然,,比如这款华为荣耀...) 手机安装KingRoot等软件,,,失败 电脑上安装连接手机Root,,,,失败 ...
- asp.net MVC4总结
MVC4构建例子 新建MVC4项目 在项目工程下面的App_Data文件夹下面添加新建项->数据-> Sql server 数据库文件Movies.mdf 新建movies.cs模型类 ...
- .c与.cpp的区别解析
这几天在练习数据结构等知识的时候,有时遇见文件保存为c后缀则能编译通过,有时又是保存cpp后缀才能通过.对于这个都没能区分清,是自己的基本功问题,于是百度了一下.幸好有许多和我一样有问题的人. 其实简 ...