Unable to make the session state request to the session state server处理方法

Server Error in ‘/‘ Application.


Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either ‘localhost‘ or ‘127.0.0.1‘ as the server name.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Web.HttpException: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either ‘localhost‘ or ‘127.0.0.1‘ as the server name.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80072749): Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either ‘localhost‘ or ‘127.0.0.1‘ as the server name.]
   System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults& results) +3630272
   System.Web.SessionState.OutOfProcSessionStateStore.DoGet(HttpContext context, String id, StateProtocolExclusive exclusiveAccess, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +422
   System.Web.SessionState.OutOfProcSessionStateStore.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +53
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1076
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

方法一:

打开站点目录下的web.config文件,定位到配置节,

<sessionState mode="StateServer"
    stateConnectionString="tcpip=127.0.0.1:10001"
    cookieless="false" timeout="60" />

这里将 mode="StateServer" 修改为 mode="InProc" 即可。

方法二:

不修改 mode="StateServer" ,修改 stateConnectionString="tcpip=127.0.0.1:10001" 。

定位到注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\

将 stateConnectionString="tcpip=127.0.0.1:10001"配置的端口修改为注册表项Port的(42424)端口号即可,如下:

stateConnectionString="tcpip=127.0.0.1:42424"

时间: 2024-08-10 02:11:18

Unable to make the session state request to the session state server处理方法的相关文章

Unable to make the session state request to the session state server处理

Server Error in '/' Application. Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, p

转: 解决【Unable to make the session state request to the session state server】

错误描述: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accept

架构之路(九)Session Per Request

前面的两篇反应很差:没评论没赞.很伤心啊,为什么呢?搞得我好长一段时间都没更新了——呵呵,好吧,我承认,这只是我的借口.不过,还是希望大家多给反馈.没有反馈,我就只能猜了:前面两篇是不是写得太“粗”了一点?所以这一篇我们尽量详细点吧. Session Per Request是什么 这是一个使用NHibernate构建Web项目惯用的模式,相关的文章其实很多.我尽量用我的语言(意思是大白话,但可能不精确)来做一个简单的解释. 首先,你得明白什么是session.这不是ASP.NET里面的那个ses

解决在XXXXService中访问session、request、params、servletcontext等等问题

在最近的开发过程中,遇到了在service中访问session.request.params等对象中的一些内容,解决方法如下 import org.codehaus.groovy.grails.web.util.WebUtilsimport org.springframework.web.context.request.RequestContextHolder class WebUtilTools {    def static getRequest(){        def webUtils

action访问servlet的API并且获取到MAP类型的application,session,request

public class testAction3 extends ActionSupport { private Map<String,Object> request; private Map<String,Object> session; private Map<String,Object> application; /** * 构造函数,没有返回值 */ public testAction3(){ this.request=(Map) ActionContext.g

request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别(记录)

1.session.setAttribute()和session.getAttribute()配对使用,作用域是整个会话期间,在所有的页面都使用这些数据的时候使用. 2.request.setAttribute()和request.getAttribute()配对使用,作用域是请求和被请求页面之间.request.setAttribute()是只在此action的下一个forward需要使用的时候使用:request.getAttribute()表示从request范围取得设置的属性,必须要先s

Webx学习笔记(八)Request Context之Session

1 Session概述 HTTP协议是无状态的,但通过session机制,就能把无状态的变成有状态的.Session的功能就是保存HTTP请求之间的状态数据.有了session的支持,就很容易实现诸如用户登录.购物车等网站功能.在Servlet API中,有一个HttpSession的接口. 在Java代码中访问session //在一个请求中,保存session的状态 // 取得session对象 HttpSession session = request.getSession(); // 在

springMVC 获取request 处理全局session业务

<a target=_blank href="http://blog.csdn.net/is_zhoufeng/article/details/7559756" style="color: rgb(0, 0, 0); text-decoration: none; font-family: 'Microsoft YaHei'; font-size: 20px; line-height: 30px; ">springMVC中得到request对象,sessi

request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别

1.session.setAttribute()和session.getAttribute()配对使用,作用域是整个会话期间,在所有的页面都使用这些数据的时候使用. 2.request.setAttribute()和request.getAttribute()配对使用,作用域是请求和被请求页面之间. request.setAttribute()是只在此action的下一个forward需要使用的时候使 用:request.getAttribute()表示从request范围取得设置的属性,必须要