简体   繁体   English

ASP.NET异常在YSOD上提供了无关的堆栈跟踪,非常具有挑战性!

[英]ASP.NET exception gives irrelevant stack trace on YSOD, very challenging!

Here is the YSOD: 这是YSOD:

Timeout expired. 超时已过期。 The timeout period elapsed prior to completion of the operation or the server is not responding. 操作完成之前经过的超时时间或服务器没有响应。 Description: An unhandled exception occurred during the execution of the current web request. 描述:执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code. 请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. 异常详细信息:System.Data.SqlClient.SqlException:超时已过期。 The timeout period elapsed prior to completion of the operation or the server is not responding. 操作完成之前经过的超时时间或服务器没有响应。

Source Error: An unhandled exception was generated during the execution of the current web request. 源错误:在执行当前Web请求期间生成了未处理的异常。 Information regarding the origin and location of the exception can be identified using the exception stack trace below. 可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

Stack Trace: 堆栈跟踪:

[SqlException (0x80131904): Timeout expired. [SqlException(0x80131904):超时已过期。 The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 ECommerce.PMethod.Sql.SqlConns.Open() +78 ECommerce.PMethod.Sql.SqlConns..ctor() +120 ECommerce.login.DatasInfo.Proc.UserCenter.IsLogin(String UserGUID, Int32 UserID) +49 ECommerce.login.Rules.Users.UserLogin.isLogin() +44 Config.isUserLogined() +5 Shopping_Shopping.Page_Load(Object sender, EventArgs e) +10 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) + 操作完成之前经过的超时时间或服务器没有响应。] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)+428 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)+65 System。 Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)+117 System.Data.SqlClient.SqlConnection.Open()+ 122 ECommerce.PMethod.Sql.SqlConns.Open()+78 ECommerce.PMethod.Sql.SqlConns。 .ctor()+120 ECommerce.login.DatasInfo.Proc.UserCenter.IsLogin(String UserGUID,Int32 UserID)+49 ECommerce.login.Rules.Users.UserLogin.isLogin()+44 Config.isUserLogined()+5 Shopping_Shopping。 Page_Load(Object sender,EventArgs e)+10 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,Object o,Object t,EventArgs e)+14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e)+ 99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 99 System.Web.UI.Control.LoadRecursive()+50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+627

[TypeInitializationException: The type initializer for 'ECommerce.ERP.DAL.DBConn' threw an exception.] ECommerce.ERP.DAL.DBConn.get_ConnString() +0 [TypeInitializationException:'ECommerce.ERP.DAL.DBConn'的类型初始值设定项引发异常。] ECommerce.ERP.DAL.DBConn.get_ConnString()+ 0

[ObjectDefinitionStoreException: Factory method 'System.String get_ConnString()' threw an Exception.] Spring.Objects.Factory.Support.SimpleInstantiationStrategy.Instantiate(RootObjectDefinition definition, String name, IObjectFactory factory, MethodInfo factoryMethod, Object[] arguments) +257 Spring.Objects.Factory.Support.ConstructorResolver.InstantiateUsingFactoryMethod(String name, RootObjectDefinition definition, Object[] arguments) +624 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateUsingFactoryMethod(String name, RootObjectDefinition definition, Object[] arguments) +60 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +56 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +436 [ObjectDefinitionStoreException:Factory方法'System.String get_ConnString()'抛出一个Exception。] Spring.Objects.Factory.Support.SimpleInstantiationStrategy.Instantiate(RootObjectDefinition定义,String name,IObjectFactory factory,MethodInfo factoryMethod,Object [] arguments)+257 Spring .Objects.Factory.Support.ConstructorResolver.InstantiateUsingFactoryMethod(String name,RootObjectDefinition definition,Object [] arguments)+624 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateUsingFactoryMethod(String name,RootObjectDefinition definition,Object [] arguments)+60 Spring .Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName,RootObjectDefinition objectDefinition,Object [] arguments)+56 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name,RootObjectDefinition definition,Object [] arguments,Boolean allowEagerCaching, Boolean suppressConfigure)+436

[ObjectCreationException: Error thrown by a dependency of object 'styleService' defined in 'assembly [ECommerce.Services.Impl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [ECommerce.Services.Impl.AppContext.xml] line 56' : Initialization of object failed : Factory method 'System.String get_ConnString()' threw an Exception. [ObjectCreationException:由'assembly [ECommerce.Services.Impl,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]中定义的对象'styleService'的依赖项引发的错误,资源[ECommerce.Services.Impl.AppContext.xml ]第56行:对象的初始化失败:工厂方法'System.String get_ConnString()'引发了异常。 while resolving 'constructor argument with name promotionservice' to 'promotionService' defined in 'assembly [ECommerce.Services.Impl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [ECommerce.Services.Impl.AppContext.xml] line 31' while resolving 'constructor argument with name domainservice' to 'promotionDomainService' defined in 'assembly [ECommerce.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [ECommerce.Domain.AppContext.xml] line 20' while resolving 'constructor argument with name promotionrepos' to 'promotionRepos' defined in 'assembly [ECommerce.Data.AdoNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [ECommerce.Data.AdoNet.AppContext.xml] line 34' while resolving 'constructor argument with name connstr' to 'ECommerce.ERP.DAL.DBConn#389F399' defined in 'assembly [ECommerce.Data.AdoNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [ECommerce.Data.AdoNet.AppContext.xml] line 34'] Spring.Objects. 同时解析'assembly promotionservice'中的'constructor参数'到'assembly [ECommerce.Services.Impl,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]中定义的'promotionService',资源[ECommerce.Services.Impl.AppContext.xml ]第31行'同时解析'name domainservice'的'constructor参数'到'assembly [ECommerce.Domain,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]中定义的'promotionDomainService',资源[ECommerce.Domain.AppContext.xml ] 20行'同时解析'construcingrepos'的'构造函数参数'到'assemblyRepos'在'assembly [ECommerce.Data.AdoNet,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null]中定义,资源[ECommerce.Data.AdoNet] .AppContext.xml]第34行同时将'构造函数参数与名称connstr'解析为'ECommerce.ERP.DAL.DBConn#389F399'在'assembly [ECommerce.Data.AdoNet,Version = 1.0.0.0,Culture = neutral, PublicKeyToken = null],资源[ECommerce.Data.AdoNet.AppContext.xml]第34行'] Spring.Objects。 Factory.Support.ObjectDefinitionValueResolver.ResolveReference(IObjectDefinition definition, String name, String argumentName, RuntimeObjectReference reference) +394 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +312 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +17 Spring.Objects.Factory.Support.ConstructorResolver.ResolveConstructorArguments(String objectName, RootObjectDefinition definition, ObjectWrapper wrapper, ConstructorArgumentValues cargs, ConstructorArgumentValues resolvedValues) +993 Spring.Objects.Factory.Support.ConstructorResolver.AutowireConstructor(String objectName, RootObjectDefinition rod, ConstructorInfo[] chosenCtors, Object[] explicitArgs) +171 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.AutowireC Factory.Support.ObjectDefinitionValueResolver.ResolveReference(IObjectDefinition definition,String name,String argumentName,RuntimeObjectReference reference)+394 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name,IObjectDefinition definition,String argumentName,Object argumentValue)+312 Spring。 Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name,IObjectDefinition definition,String argumentName,Object argumentValue)+17 Spring.Objects.Factory.Support.ConstructorResolver.ResolveConstructorArguments(String objectName,RootObjectDefinition definition,ObjectWrapper wrapper,ConstructorArgumentValues cargs,ConstructorArgumentValues resolvedValues )+993 Spring.Objects.Factory.Support.ConstructorResolver.AutowireConstructor(String objectName,RootObjectDefinition rod,ConstructorInfo [] chosenCtors,Object [] explicitArgs)+171 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.AutowireC onstructor(String name, RootObjectDefinition definition, ConstructorInfo[] ctors, Object[] explicitArgs) +65 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +161 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +636 Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +174 Spring.Objects.Factory.Support.WebObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +150 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) +990 Spring.Objects.Factory onstructor(String name,RootObjectDefinition definition,ConstructorInfo [] ctors,Object [] explicitArgs)+65 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName,RootObjectDefinition objectDefinition,Object [] arguments)+161 Spring.Objects.Factory .Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name,RootObjectDefinition definition,Object [] arguments,Boolean allowEagerCaching,Boolean suppressConfigure)+636 Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName,RootObjectDefinition objectDefinition,Object [] arguments)+ 174 Spring.Objects.Factory.Support.WebObjectFactory.CreateAndCacheSingletonInstance(String objectName,RootObjectDefinition objectDefinition,Object [] arguments)+150 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name,Type requiredType,Object [] arguments,Boolean suppressConfigure)+990 Spring.Objects.Factory .Support.AbstractObjectFactory.GetObject(String name) +10 Spring.Context.Support.AbstractApplicationContext.GetObject(String name) +20 ECommerce.Common.ServiceLocator.GetService() +334 ECommerce.Mvc.Controllers.StylesController..ctor() +72 .Support.AbstractObjectFactory.GetObject(String name)+10 Spring.Context.Support.AbstractApplicationContext.GetObject(String name)+20 ECommerce.Common.ServiceLocator.GetService()+334 ECommerce.Mvc.Controllers.StylesController..ctor() +72

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230 System.Activator.CreateInstance(Type type, Boolean nonPublic) +67 System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +80 [TargetInvocationException:调用目标抛出了异常。] System.RuntimeTypeHandle.CreateInstance(RuntimeType类型,Boolean publicOnly,Boolean noCheck,Boolean&canBeCached,RuntimeMethodHandle&ctor,Boolean&bNeedSecurityCheck)+0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)+86 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly,Boolean skipVisibilityChecks,Boolean fillCache)+230 System.Activator.CreateInstance(Type type,Boolean nonPublic)+67 System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext,Type controllerType)+80

[InvalidOperationException: An error occurred when trying to create a controller of type 'ECommerce.Mvc.Controllers.StylesController'. [InvalidOperationException:尝试创建“ECommerce.Mvc.Controllers.StylesController”类型的控制器时发生错误。 Make sure that the controller has a parameterless public constructor.] System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +190 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +68 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +118 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +46 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +63 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +13 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8677954 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 确保控制器具有无参数的公共构造函数。] System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext,Type controllerType)+190 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext,String controllerName)+68 System。 Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext,IController&controller,IControllerFactory&factory)+118 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext,AsyncCallback callback,Object state)+46 System.Web.Mvc.MvcHandler.BeginProcessRequest( HttpContext httpContext,AsyncCallback callback,Object state)+63 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context,AsyncCallback cb,Object extraData)+13 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication。 IExecutionStep.Execute()+8677954 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean&completedSynchronously)+155


Version Information: Microsoft .NET Framework Version:2.0.50727.3082; 版本信息:Microsoft .NET Framework版本:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 ASP.NET版本:2.0.50727.3082

Question is: the first stack trace is irrelevant to others, what happened? 问题是:第一个堆栈跟踪与其他人无关,发生了什么? Any ideas? 有任何想法吗?

Let me make this more clear: 让我说清楚一点:

a MVC page uses the spring part trying to load a lazy-init service which constructor wants a connection string through a static property like this: 一个MVC页面使用spring部分尝试加载一个lazy-init服务,构造函数想要一个连接字符串通过这样的静态属性:

<object id="promotionRepos" type="ECommerce.Data.AdoNet.Promotions.PromotionRepos, ECommerce.Data.AdoNet" lazy-init="true">
    <constructor-arg name="provider">
        <null />
    </constructor-arg>
    <constructor-arg name="connStr">
        <object type="ECommerce.ERP.DAL.DBConn, ECommerce.ERP.DAL" factory-method="get_ConnString" />
    </constructor-arg>
    <property name="RefreshInterval" value="00:00:10" />
</object>

the timeout part is some what irrelevent to all others. 超时部分对所有其他人来说是无关紧要的。 see this in the first exception: Shopping_Shopping.Page_Load(Object sender, EventArgs e) +10 it's another page at all. 在第一个例外中看到这个:Shopping_Shopping.Page_Load(Object sender,EventArgs e)+10它是另一个页面。 And also, ECommerce.PMethod.Sql.SqlConns.Open() uses its own connection string, not the one loaded by spring, it's different module from diffrent team. 而且,ECommerce.PMethod.Sql.SqlConns.Open()使用自己的连接字符串,而不是spring加载的连接字符串,它是来自不同团队的不同模块。 And I am sure the connection string is correct. 我确信连接字符串是正确的。

And, this ysod cames up randomly. 并且,这个ysod随机出现。 Sometimes nothing is wrong, and sometimes, it appears. 有时没有错,有时,它似乎。

I thought there could be something wrong with my database or the network/firewall, I will check it later, but now I want understand this tricky stack trace. 我以为我的数据库或网络/防火墙可能有问题,我稍后会检查,但现在我想了解这个棘手的堆栈跟踪。

Looks to me like they are all relevant. 在我看来他们都是相关的。 They seem to be to do with instantiating objects using Spring.Net. 它们似乎与使用Spring.Net实例化对象有关。 Ultimately it looks like your database server is either not responding or your connection string is completely wrong. 最终看起来您的数据库服务器没有响应或您的连接字符串完全错误。

Can you access the database using the DB managemnet software that you use? 您可以使用您使用的DB managemnet软件访问数据库吗?

Im guessing that your connection string is wrong or the database server is not turned on when your application tries to connect to the database. 我猜你的连接字符串错误或者当你的应用程序试图连接到数据库时数据库服务器没有打开。 Double check your connection string. 仔细检查您的连接字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM