Can't get WebApplicationContext object from ContextRegistry.GetContext(): Resource handler for t

Posted 落叶潇潇雨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Can't get WebApplicationContext object from ContextRegistry.GetContext(): Resource handler for t相关的知识,希望对你有一定的参考价值。

I‘m stucked in configuring my web.config file under a web forms project in order to get an instance of WebApplicationContext (at Global.asax) and then being able to use scope="application | session | request"

<sectionGroup name="spring"> <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/> <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" /> </sectionGroup>  <spring> <context type="Spring.Context.Support.WebApplicationContext, Spring.Web"> <resource uri="~/Configuration/Spring.xml" /> </context> </spring>  <httpHandlers> <add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/> </httpHandlers>  <httpModules> <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/> </httpModules>

I‘m then trying to add the WebApplicationContext to my Application object, in order to cosume on any .aspx page;

protected void Application_Start(object sender, EventArgs e) { //Exception happens on next line! Application.Add("ContainerID", ContextRegistry.GetContext()); }

Exception I‘m getting is;

"Error creating context ‘spring.root‘: Resource handler for the ‘web‘ protocol is not defined. Spring.NET"


Add this to system.webServer config node:

<modules runAllManagedModulesForAllRequests="true">
  <add name="Spring" preCondition="integratedMode" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
</modules>   

If you use integratedMode in IIS7


pasting

以上是关于Can't get WebApplicationContext object from ContextRegistry.GetContext(): Resource handler for t的主要内容,如果未能解决你的问题,请参考以下文章

MySQL: ERROR13(HY000):Can't get stat of

Can't get WebApplicationContext object from ContextRegistry.GetContext(): Resource handler for t

Linux在安装时出现_X11TransSocketINETConnect() :can't get

MySQL数据库罕见的BUG——Can't get hostname for your address

mysql报错1024-can't get hostname for your address

hbase.client.RetriesExhaustedException: Can't get the locations hive关联Hbase查询报错