2011-05-05 172 views
3

我很难重新生成场景或读取我今天在日志中得到的下面的错误..通常堆栈跟踪将指向文件和行号等,但作为你可以看到它下面只是说nullreference例外没有给我具体的位置。我希望如果你能帮助我读入到此并找出exaclty正在发生的事情..难以理解堆栈轨迹

System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
    at ASP.views_reservation_checkout_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at ASP.content_kismetvacation_views_shared_site_master.__RenderBodyContent(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at ASP.content_kismetvacation_views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.HandleError(Exception e) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest() 
    at System.Web.UI.Page.ProcessRequest(HttpContext context) 
    at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context) 
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() 
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) 
    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) 
    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) 
    at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) 
    at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) 
    at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext) 
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) 
    at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11() 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) 
    at System.Web.Mvc.Controller.ExecuteCore() 
    at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4() 
    at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0() 
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
    at ASP.views_reservation_checkout_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at ASP.content_kismetvacation_views_shared_site_master.__RenderBodyContent(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at ASP.content_kismetvacation_views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
    at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.HandleError(Exception e) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
    at System.Web.UI.Page.ProcessRequest() 
    at System.Web.UI.Page.ProcessRequest(HttpContext context) 
    at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context) 
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() 
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) 
    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) 
+0

你有所有的服务器上可用的PDB文件? – Gabe 2011-05-05 01:18:18

回答

0

呀,空引用异常可以有点棘手。它看起来像是在“预订结帐”视图内发生的。

3

堆栈跟踪的第一行来自最深处(发生错误的位置)和下面的行,因为它会将堆栈备份起来。

我删除了System。*条目(它浸入到.NET Framework中),剩下的部分是您的页面和类。它使更多的可读性,也许更易于管理...

System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
    at ASP.views_reservation_checkout_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) 
    at ASP.content_kismetvacation_views_shared_site_master.__RenderBodyContent(HtmlTextWriter __w, Control parameterContainer) 
    at ASP.content_kismetvacation_views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
    at ASP.views_reservation_checkout_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) 
    at ASP.content_kismetvacation_views_shared_site_master.__RenderBodyContent(HtmlTextWriter __w, Control parameterContainer) 
    at ASP.content_kismetvacation_views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 

我看到你的内容页面有:* views_reservation_checkout_aspx *
和一个视图:* content_kismetvacation_views_shared_site_master *

最深点显示网页名为ASP.views_reservation_checkout_aspx(ASP/views/reservation/checkout.aspx?),因此您应该将调试工作集中在那里的对象和控件上。

事情在页面尝试:

  • 在Visual Studio中设置断点
    • 和逐步执行代码行由行,
    • 沿途检查的事情实例为null
    • 查找空的实例的成员调用(例如方法或属性)。
  • 修复和重复
+0

谢谢,为什么它不会告诉异常的行号?我看到我得到它的其他例外..会有一些相关的配置web.config强制执行此操作或编译调试模式可以帮助吗? – kaivalya 2011-05-05 01:08:38

+0

我肯定会将它置于调试模式,但我不确定这是否会解决行号。如果您没有找到行号问题的答案,则可以将其作为单独的独立问题发布。 – 2011-05-05 01:12:00

+0

@kaivalya:对于行号,您通常需要将其设置为调试模式,并将所有相应的pdb文件放在服务器上。出于性能原因,不建议在生产现场使用。 – NotMe 2011-05-05 01:12:22