在对程序进行了一些修改后,运行发现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. android延迟执行

     延迟执行可以通过以下操作实现,按照推荐的顺序列出来 1. new Handler().postDelayed(new Runnable(){ public void run() { //execut ...

  2. Brainfuck与Ook!编程语言解析与解密

    MarkdownPad Document html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,ab ...

  3. Exiting the Matrix: Introducing Metasploit's Hardware Bridge

    Metasploit is an amazing tool. You can use it to maneuver through vast networks, pivoting through se ...

  4. jquery的deferred异步

    推荐方法: var wait = function(dtd){ var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象 var tasks = function( ...

  5. cmake的两个命令: option 和 configure_file

    本节要讨论的是cmake的两个命令: option 和 configure_file option 选项,让你可以根据选项值进行条件编译. configure_file 配置文件,让你可以在代码文件中 ...

  6. 一篇知乎的故事 - javascript技术贴

    前言 就像文章题目所示,本文的发表源于知乎的一篇文章.文章链接如下:如果你想靠前端技术还房贷,你不能连这个都不会.这篇文章是群里水群时别人发的,像我这样的菜鸟角色才不会逛知乎~~~.这篇文章主要是讲了 ...

  7. 《JavaScript DOM 编程艺术》

    前几天京东买了一本书,在豆瓣上好评如潮,买下了啃一啃,书名<JavaScript DOM 编程艺术>,在好好深造一下javaScript.一边啃,一边敲.当然应该要做好笔记.一些简单的就看 ...

  8. 构建Docker平台【第二篇】安装 Docker

    第一步:上传安装包和 docker 镜像 1.安装包: docker-engine-1.12.1-1.el7.centos.x86_64.rpm docker-engine-selinux-1.12. ...

  9. http服务搭建

    http服务器搭建 主配置文件在 /etc/httpd/conf/httpd.conf 安装http  yum install httpd -y 启动http服务器  systemctl start ...

  10. angular : $location & $state(UI router)的关系

    次序:angular 的 location会先跑 $rootScope.$on("$locationChangeStart", function (scope, newUrl, o ...