在对程序进行了一些修改后,运行发现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的更多相关文章

  1. Scope 'request' is not active for the current thread

    Unable to instantiate Action, getUserAction, defined for 'getUser' in namespace '/'Error creating be ...

  2. 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 ...

  3. 部署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 ...

  4. 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 ...

  5. Spring+Hibernate4 Junit 报错No Session found for current thread

    论坛上有另外一篇更全面的帖子,jinnianshilongnian写的:http://www.iteye.com/topic/1120924 本文的环境是:  spring-framework-3.1 ...

  6. spring报错NoClassDefFoundError等与第三方jar包导入问题

    今天配置spring,遇到各种报错的问题,做一个小小总结. 1.刚开始我忘了引入commons-logging,报错.--解决方式:下载并引入该jar包 2.spring以及commons-loggi ...

  7. spring 报错

    一. java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter 解决方案: 1. ...

  8. .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方法 ...

  9. 报错解决——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 ...

随机推荐

  1. C++ Primer 笔记 第三章

    C++ Primer 第三章 标准库类型 3.1using声明 例: using namespace atd; using std::cin; 3.2string类型 初始化方式 string s1 ...

  2. iOS-直播开发(开发从底层做起)

    一直在忙, 也没写过几次播客! 但一直热衷于直播开发技术, 公司又不是直播方向的, 所以就年前忙里偷袭研究了一下直播开发, 然后翻阅了很多大神的技术博客等, 写了一个简单的Demo, 又根据网上大神们 ...

  3. iOS视频压缩处理

    最近忙于项目开发, 昨天才完成整个项目的开发, 今天就抽出时间, 分享一下我在开发中所涉及到的技术问题! 由于近期开发涉及到视频, 所以视频压缩, 上传, 播放等一系列功能都是要涉及到的, 所以在此, ...

  4. Myeclipse插件将wsdl生成java客户端代码

    一.建立webservice服务端: 1.新建一个web service project,名称为webservice_server截图如下,点击finish. 2.选择工程,点击右键,选择new-&g ...

  5. Jasmine基础语法

    简介 Jasmine 是JavaScript的测试框架,它不依赖其他框架,也不依赖DOM,更重要的是它语法简单.以下实例都是基于Jasmine 2.5.2的,并且来自官网:https://jasmin ...

  6. 【G】开源的分布式部署解决方案(三) - 一期规划定稿与初步剖析

    G.系列导航 [G]开源的分布式部署解决方案 - 预告篇 [G]开源的分布式部署解决方案(一) - 开篇 [G]开源的分布式部署解决方案(二) - 好项目是从烂项目基础上重构出来的 [G]开源的分布式 ...

  7. DataTable && SqlDataReader帮助理解小程序

    // 2015/07/08 using System; using System.Collections.Generic; using System.Linq; using System.Text; ...

  8. 理解zookeeper选举机制

    *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...

  9. GDKOI2015滚粗记

    又是愉悦的滚粗了hahaha(特别不甘心啊啊啊) 其实去比赛每次都一样啦,就是每次吃饭睡觉补番考试评讲互黑跪烂什么的,这次就不用说了啦,先把老师要求写的东西贴出来再写点别的啦 这次暴露了很多问题,首先 ...

  10. Javascript匿名函数

    单独的匿名函数无法运行,就算能运行,也无法调用.解决办法如下: 法1. //把匿名函数赋值给变量 var box=function(){ return "Lee"; }; aler ...