难道就没人遇到过这样的问题

时间:2022-12-03 20:10:21
项目的框架是采用ASP.Net Mvc +Spring做的,
现在系统在IIS上发布有点问题,期待各位帮帮忙,看是什么原因,
程序我生成好发布到IIS上没问题,等过段时间去访问就会有问题,能后我重新生成再放上去就可以了,但是等一短时间又不行了。找了很久都没有找到原因,

错误信息
Could not load type from string value 'Service.FrameService'. 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.TypeLoadException: Could not load type from string value 'Service.FrameService'.

源错误: 

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

估计这是看不出什么错误,

下面是堆栈跟踪的一部分错误

[TypeLoadException: Could not load type from string value 'Service.FrameService'.]
   Spring.Core.TypeResolution.TypeResolver.Resolve(String typeName) in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Core\TypeResolution\TypeResolver.cs:81
   Spring.Core.TypeResolution.GenericTypeResolver.Resolve(String typeName) in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Core\TypeResolution\GenericTypeResolver.cs:97
   Spring.Core.TypeResolution.CachedTypeResolver.Resolve(String typeName) in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Core\TypeResolution\CachedTypeResolver.cs:107
   Spring.Core.TypeResolution.TypeResolutionUtils.ResolveType(String typeName) in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Core\TypeResolution\TypeResolutionUtils.cs:106
   Spring.Objects.Factory.Support.AbstractObjectDefinition.ResolveObjectType() in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectDefinition.cs:640
   Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinition rod, String objectName) in E:\MVC+Spring\Spring1.3\Spring.NET-1.3.0-RC1\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectFactory.cs:1064

9 个解决方案

#1


Spring.config的代码

<?xml version="1.0" encoding="utf-8" ?>

<objects xmlns="http://www.springframework.net">

  <!-- IOC 配置 -->
  <!-- Controller -->
   <object id="Frame" type="MVC.Controllers.FrameController" singleton="false">
    <property name="frameService" ref="FrameService"/>
     <property name="docAndMessageService" ref="DocAndMessageService"></property>
  </object>
  <object id="History" type="MVC.Controllers.HistoryController" singleton="false">
    <property name="historyService" ref="HistoryService"/>
  </object>
  <object id="Public" type="MVC.Controllers.PublicController" singleton="false">
    <property name="modelService" ref="ModelService"/>
  </object>
  <object id="ModelPages" type="MVC.Controllers.ModelPagesController" singleton="false">
    <property name="model1Service" ref="DocModel1Service" />
    <property name="attService" ref="AttachmentService" />
    <property name="docAndAttService" ref="DocAndAttachmentService"/>
    <property name="messageService" ref="MessageService"/>
    <property name="docAndMessageService" ref="DocAndMessageService"></property>
    <property name="userService" ref="UserService"></property>
  </object>
  
  
  <!-- Service -->
  <object id="FrameService" type="Service.FrameService">
    <property name="treeBLL" ref="TreeBLL"/>
  </object>
  <object id="HistoryService" type="Service.HistoryService">
    <property name="historyBLL" ref="Pub_HistoryBLL"/>
  </object>
  <object id="ModelService" type="Service.ModelService">
    <property name="modelBLL" ref="Pub_ModelBLL"/>
  </object>
  <object id="DocModel1Service" type="Service.DocModel1Service">
    <property name="model1BLL" ref="Doc_Model1BLL"/>
  </object>
  <object id="AttachmentService" type="Service.AttachmentService">
    <property name="attBLL" ref="Pub_AttachmentBLL"></property>
  </object>
  <object id="DocAndAttachmentService" type="Service.DocAndAttachmentService">
    <property name="docAndAttBLL" ref="Ref_DocAndAttachmentBLL" ></property>
  </object>
  <object id="MessageService" type="Service.MessageService">
    <property name="messBLL" ref="Pub_MessageBLL" ></property>
  </object>
  <object id="DocAndMessageService" type="Service.DocAndMessageService">
    <property name="docAndMessage" ref="Ref_DocAndMessageBLL"></property>
  </object>
  <object id="UserService" type="Service.UserService">
    <property name="userModel" ref="Pub_UserBLL"></property>
  </object>
  
 

  <!-- BLL -->
  <object id="TreeBLL" type="BLL.TreeBLL"></object>
  <object id="Pub_HistoryBLL" type="BLL.Pub_HistoryBLL"></object>
  <object id="Pub_ModelBLL" type="BLL.Pub_ModelBLL"></object>
  <object id="Doc_Model1BLL" type="BLL.Doc_Model1BLL"></object>
  <object id="Pub_AttachmentBLL" type="BLL.Pub_AttachmentBLL"></object>
  <object id="Ref_DocAndAttachmentBLL" type="BLL.Ref_DocAndAttachmentBLL"></object>
  <object id="Pub_MessageBLL" type="BLL.Pub_MessageBLL"></object>
  <object id="Ref_DocAndMessageBLL" type="BLL.Ref_DocAndMessageBLL"></object>
  <object id="Pub_UserBLL" type="BLL.Pub_UserBLL"></object>
  
  <!-- 数据库配置 -->
  <object id ="DbProvider" type ="Spring.Data.Common.DbProviderFactory,Spring.Data"
                 factory-method ="GetDbProvider" >
    <constructor-arg name ="providerInvariantName" value ="System.Data.SqlClient"></constructor-arg>
    <property name ="ConnectionString" value ="server=192.168.2.116\SQLEXPRESS;uid=sa;pwd=****;database=Plantform"></property>
  </object>
  <object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="DataReaderWrapperType" value="Spring.Data.Support.NullMappingDataReader, Spring.Data"/>
  </object>

  <object id="TxProxyConfigurationTemplate" abstract="true" type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
    <property name="PlatformTransactionManager" ref="TransactionManager"/>
         <property name="TransactionAttributes">
            <name-values>
                 <!-- 你要把哪些 method(s) 納入交易控管 -->
                 <add key="Insert*" value="PROPAGATION_REQUIRED" />
                 <add key="Update*" value="PROPAGATION_REQUIRED" />
                 <add key="Delete*" value="PROPAGATION_REQUIRED" />
                 <add key="Create*" value="PROPAGATION_REQUIRED" />
                 <add key="Save*" value="PROPAGATION_REQUIRED"/>
                 <add key="Copy*" value="PROPAGATION_REQUIRED"/>
                 <add key="Afresh*" value="PROPAGATION_REQUIRED"/>
                 <add key="TransferCase" value="PROPAGATION_REQUIRED"/>        
      </name-values>
    </property>
  </object>





</objects>

#2


    怎么没人来了。

#3


都一天了,还是没人来啊。自己顶。。。

#4


难道.net的spring还是这种配置么!汗........

#5


哇哇 我也来顶一下

#6


该回复于2010-09-29 14:00:51被版主删除

#7


中毒了,过段时间就会删文件?
把生成的和出错的版本所有文件都比一遍beyond compare

#8


不太懂 路過幫忙頂下

#9


楼主,我也碰到这问题了,难道你就没有解决?

#1


Spring.config的代码

<?xml version="1.0" encoding="utf-8" ?>

<objects xmlns="http://www.springframework.net">

  <!-- IOC 配置 -->
  <!-- Controller -->
   <object id="Frame" type="MVC.Controllers.FrameController" singleton="false">
    <property name="frameService" ref="FrameService"/>
     <property name="docAndMessageService" ref="DocAndMessageService"></property>
  </object>
  <object id="History" type="MVC.Controllers.HistoryController" singleton="false">
    <property name="historyService" ref="HistoryService"/>
  </object>
  <object id="Public" type="MVC.Controllers.PublicController" singleton="false">
    <property name="modelService" ref="ModelService"/>
  </object>
  <object id="ModelPages" type="MVC.Controllers.ModelPagesController" singleton="false">
    <property name="model1Service" ref="DocModel1Service" />
    <property name="attService" ref="AttachmentService" />
    <property name="docAndAttService" ref="DocAndAttachmentService"/>
    <property name="messageService" ref="MessageService"/>
    <property name="docAndMessageService" ref="DocAndMessageService"></property>
    <property name="userService" ref="UserService"></property>
  </object>
  
  
  <!-- Service -->
  <object id="FrameService" type="Service.FrameService">
    <property name="treeBLL" ref="TreeBLL"/>
  </object>
  <object id="HistoryService" type="Service.HistoryService">
    <property name="historyBLL" ref="Pub_HistoryBLL"/>
  </object>
  <object id="ModelService" type="Service.ModelService">
    <property name="modelBLL" ref="Pub_ModelBLL"/>
  </object>
  <object id="DocModel1Service" type="Service.DocModel1Service">
    <property name="model1BLL" ref="Doc_Model1BLL"/>
  </object>
  <object id="AttachmentService" type="Service.AttachmentService">
    <property name="attBLL" ref="Pub_AttachmentBLL"></property>
  </object>
  <object id="DocAndAttachmentService" type="Service.DocAndAttachmentService">
    <property name="docAndAttBLL" ref="Ref_DocAndAttachmentBLL" ></property>
  </object>
  <object id="MessageService" type="Service.MessageService">
    <property name="messBLL" ref="Pub_MessageBLL" ></property>
  </object>
  <object id="DocAndMessageService" type="Service.DocAndMessageService">
    <property name="docAndMessage" ref="Ref_DocAndMessageBLL"></property>
  </object>
  <object id="UserService" type="Service.UserService">
    <property name="userModel" ref="Pub_UserBLL"></property>
  </object>
  
 

  <!-- BLL -->
  <object id="TreeBLL" type="BLL.TreeBLL"></object>
  <object id="Pub_HistoryBLL" type="BLL.Pub_HistoryBLL"></object>
  <object id="Pub_ModelBLL" type="BLL.Pub_ModelBLL"></object>
  <object id="Doc_Model1BLL" type="BLL.Doc_Model1BLL"></object>
  <object id="Pub_AttachmentBLL" type="BLL.Pub_AttachmentBLL"></object>
  <object id="Ref_DocAndAttachmentBLL" type="BLL.Ref_DocAndAttachmentBLL"></object>
  <object id="Pub_MessageBLL" type="BLL.Pub_MessageBLL"></object>
  <object id="Ref_DocAndMessageBLL" type="BLL.Ref_DocAndMessageBLL"></object>
  <object id="Pub_UserBLL" type="BLL.Pub_UserBLL"></object>
  
  <!-- 数据库配置 -->
  <object id ="DbProvider" type ="Spring.Data.Common.DbProviderFactory,Spring.Data"
                 factory-method ="GetDbProvider" >
    <constructor-arg name ="providerInvariantName" value ="System.Data.SqlClient"></constructor-arg>
    <property name ="ConnectionString" value ="server=192.168.2.116\SQLEXPRESS;uid=sa;pwd=****;database=Plantform"></property>
  </object>
  <object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="DataReaderWrapperType" value="Spring.Data.Support.NullMappingDataReader, Spring.Data"/>
  </object>

  <object id="TxProxyConfigurationTemplate" abstract="true" type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
    <property name="PlatformTransactionManager" ref="TransactionManager"/>
         <property name="TransactionAttributes">
            <name-values>
                 <!-- 你要把哪些 method(s) 納入交易控管 -->
                 <add key="Insert*" value="PROPAGATION_REQUIRED" />
                 <add key="Update*" value="PROPAGATION_REQUIRED" />
                 <add key="Delete*" value="PROPAGATION_REQUIRED" />
                 <add key="Create*" value="PROPAGATION_REQUIRED" />
                 <add key="Save*" value="PROPAGATION_REQUIRED"/>
                 <add key="Copy*" value="PROPAGATION_REQUIRED"/>
                 <add key="Afresh*" value="PROPAGATION_REQUIRED"/>
                 <add key="TransferCase" value="PROPAGATION_REQUIRED"/>        
      </name-values>
    </property>
  </object>





</objects>

#2


    怎么没人来了。

#3


都一天了,还是没人来啊。自己顶。。。

#4


难道.net的spring还是这种配置么!汗........

#5


哇哇 我也来顶一下

#6


该回复于2010-09-29 14:00:51被版主删除

#7


中毒了,过段时间就会删文件?
把生成的和出错的版本所有文件都比一遍beyond compare

#8


不太懂 路過幫忙頂下

#9


楼主,我也碰到这问题了,难道你就没有解决?