No object named 'DbSessionFactory' is defined

shendu74110 2017-03-01 08:54:00
“/”应用程序中的服务器错误。
No object named 'DbSessionFactory' is defined : Cannot find definition for object [DbSessionFactory]
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: Spring.Objects.Factory.NoSuchObjectDefinitionException: No object named 'DbSessionFactory' is defined : Cannot find definition for object [DbSessionFactory]

源错误:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。


其中:
controllers.xml文件内容:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net" default-autowire="constructor">

<object type="muTian.sysAdmin.UI.Portal.Controllers.UserInfoController, muTian.sysAdmin.UI.Portal" singleton="false" >
<property name="userInfoService" ref="UserInfoService" />
</object>

<object type="muTian.sysAdmin.UI.Portal.Controllers.OrderInfoController, muTian.sysAdmin.UI.Portal" singleton="false" >
<property name="orderInfoService" ref="OrderInfoService" />
</object>
</objects>

service文件内容:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">

<object name="userInfoService" type="muTian.SysAdmin.BLL.UserInfoService, muTian.SysAdmin.BLL" singleton="false" >
<property name="Dbsession" ref="DbSession" />
</object>
<object name="orderInfoService" type="muTian.SysAdmin.BLL.OrderInfoService, muTian.SysAdmin.BLL" singleton="false" >
<property name="Dbsession" ref="DbSession" />
</object>
</objects>

dals.xml文件内容:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object name="Dbsession" type="muTian.SysAdmin.DALFactory.DbSession , muTian.SysAdmin.DALFactory"
singleton="false" factory-method="GetCurrentDbSession" factory-object="DbSessionFactory"></object>
</objects>

web.config主要内容:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.MvcContextHandler, Spring.Web.Mvc5" />
<!--<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />-->
<!--<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />-->
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="file://~/Config/dals.xml" />
<resource uri="file://~/Config/service.xml" />
<resource uri="file://~/Config/controllers.xml" />
</context>
</spring>
<connectionStrings>
多谢大神帮忙看看, 万分感激.
...全文
275 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
shendu74110 2017-03-02
  • 打赏
  • 举报
回复
已解决
  <object name="DbSessionFactory" type="muTian.SysAdmin.DALFactory.DbSessionFactory, muTian.SysAdmin.DALFactory"
        singleton="true">

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧