在线等——系统日志出错,查看代码看不明白,请高手指点

消失的尘芥 2012-01-11 02:49:15
应用程序出错详情如下:

日志名称: Application
来源: ASP.NET 2.0.50727.0
日期: 2012/1/11 13:51:17
事件 ID: 1334
任务类别: 无
级别: 错误
关键字: 经典
用户: 暂缺
计算机: yoksrv1
描述:
发生未处理的异常,并已终止进程。

Application ID: /LM/W3SVC/3/ROOT

Process ID: 10304

Exception: System.NullReferenceException

Message: 未将对象引用设置到对象的实例。

StackTrace: 在 AspNetForums.ForumsHttpModule.ScheduledWorkCallbackEmailInterval(Object sender)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading._TimerCallback.PerformTimerCallback(Object state)
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 2.0.50727.0" />
<EventID Qualifiers="49152">1334</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-01-11T05:51:17.000000000Z" />
<EventRecordID>5167</EventRecordID>
<Channel>Application</Channel>
<Computer>yoksrv1</Computer>
<Security />
</System>
<EventData>
<Data>发生未处理的异常,并已终止进程。

Application ID: /LM/W3SVC/3/ROOT

Process ID: 10304

Exception: System.NullReferenceException

Message: 未将对象引用设置到对象的实例。

StackTrace: 在 AspNetForums.ForumsHttpModule.ScheduledWorkCallbackEmailInterval(Object sender)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading._TimerCallback.PerformTimerCallback(Object state)</Data>
</EventData>
</Event>


我查看的后后台代码如下:


#region 回调方法
// Timer Callbacks
// 邮件发送/匿名在线更新ScheduledWorkCallbackEmailInterval(Object sender)
private void ScheduledWorkCallbackEmailInterval(object sender)
{
if ((HttpContext)sender != null)
{
try
{
// suspend the timer while we process emails
emailTimer.Change(System.Threading.Timeout.Infinite, EmailInterval);

// Send emails
//
Emails.SendQueuedEmails((HttpContext)sender);
// Update anonymous users
//
Users.UpdateAnonymousUsers((HttpContext)sender);

// Init User Day Intrgral
Users.InitUserDayIntrgral((HttpContext)sender);
}

catch (Exception e)
{
ForumException fe = new ForumException(ForumExceptionType.EmailUnableToSend, "Scheduled Worker Thread failed.", e);
fe.Log();
}
finally
{
emailTimer.Change(EmailInterval, EmailInterval);
}
}
}

调用代码处,如下:


#region 应用程序初始化
/// <summary>
/// 应用程序初始化
/// </summary>
/// <param name="application"></param>
public void Init(HttpApplication application)
{

// Wire-up application events
//
application.BeginRequest += new EventHandler(this.Application_BeginRequest);
application.AuthenticateRequest += new EventHandler(Application_AuthenticateRequest);
application.Error += new EventHandler(this.Application_OnError);
application.AuthorizeRequest += new EventHandler(this.Application_AuthorizeRequest);

#if DEBUG
application.ReleaseRequestState += new EventHandler(this.Application_ReleaseRequestState);
#endif

ForumConfiguration forumConfig = ForumConfiguration.GetConfig();
if( forumConfig != null
&& forumConfig.IsBackgroundThreadingDisabled == false )
{
if (emailTimer == null)
[b]emailTimer = new Timer(new TimerCallback(ScheduledWorkCallbackEmailInterval), application.Context, EmailInterval, EmailInterval);[/b] if( forumConfig.IsIndexingDisabled == false && statsTimer == null )
{
statsTimer = new Timer(new TimerCallback(ScheduledWorkCallbackStatsInterval), application.Context, StatsInterval, StatsInterval);
}
if (activateEmailTimer == null)
activateEmailTimer = new Timer(new TimerCallback(ScheduledWorkCallbackActivateEmailInterval), application.Context, ActivateEmailInterval, ActivateEmailInterval);

}
...全文
99 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
消失的尘芥 2012-01-11
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 liuqian4243 的回复:]

不影响正常运行,不用管他即可
[/Quote]
是没有影响正常运行,但是服务器老是弹出调试窗口,就是这个代码报错引起的哦
Ny-6000 2012-01-11
  • 打赏
  • 举报
回复
不影响正常运行,不用管他即可
丰云 2012-01-11
  • 打赏
  • 举报
回复
你这些代码都找到了,
难道不会在debug模式下调试吗?
消失的尘芥 2012-01-11
  • 打赏
  • 举报
回复
users会出啥问题呢?请详解一下
  • 打赏
  • 举报
回复

//
Users.UpdateAnonymousUsers((HttpContext)sender);

// Init User Day Intrgral
Users.InitUserDayIntrgral((HttpContext)sender);




不知道 是不是 这个 Users 的问题

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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