Runtime Error 问题

yanxiang23 2010-02-09 09:38:57
小弟维护一个网站,最近突然出现一个问题,在网站上传一些更新内容之后,偶尔几次还好,多上传几次之后网站页面就出现了Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>



求教各位大虾该如何解决啊???到底问题出在何处呢
...全文
155 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanxiang23 2010-02-09
  • 打赏
  • 举报
回复
找到代码了。。。。
2楼的大哥能否再指点一二啊
/// <summary>
/// 根据新闻ID查询栏目ID
/// </summary>
/// <param name="newsID">新闻ID</param>
/// <returns></returns>
public static int SearchColumnID(string newsID)
{
string select_all_str = "select columnID from main_News where newsID=?newsID";
MySqlCommand com = new MySqlCommand();
com.CommandText = select_all_str;
com.Connection = my_con;
MySqlParameter p_newsID = new MySqlParameter();
p_newsID.ParameterName = "?newsID";
p_newsID.Value = newsID;
p_newsID.MySqlDbType = MySqlDbType.VarChar;
com.Parameters.Add(p_newsID);

int rowEffect = 0;
try
{
my_con.Open();
rowEffect = int.Parse(com.ExecuteScalar().ToString());
}
finally
{
my_con.Close();
}
return rowEffect;
}


其中my_con.Close();
是1397行
symbol_bc 2010-02-09
  • 打赏
  • 举报
回复
根据你在4楼的回复,这句
at SXFJ.DAL.main_News.SearchColumnID(String newsID) in d:/xxweb\App_Code\DAL\main_News.cs:line 1397
应该是在main_News.cs这个文件的1397行处错了,方法名是SearchColumnID,显然是要搜索列的id,而且写在DAL层,是一个访问数据库的错误,是这种错误经常出现的地方。
我的建议还是,如果你不是开发人员,不好搞。如果你的系统跑了好长时间了,最近才出错,那很可能你动了数据库的结构,造成的错误,建议你可以想想最近动了什么结构,改回去就好了。
否则如果系统是刚刚跑起来,那就联系开发人员吧,这属于bug了。
yanxiang23 2010-02-09
  • 打赏
  • 举报
回复
还有一个警告如下也报了很多次
:Failed to process request.

Exception: System.Threading.ThreadAbortException
Message: Thread was being aborted.
StackTrace: at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)

有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
yanxiang23 2010-02-09
  • 打赏
  • 举报
回复
2楼果然是高手啊。。。我真不是开发人员,只是负责维护更新网站内容的
我看了下日志,连续有很多警告之后,就报错了。警告如下:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2010-2-4 19:41:14
Event time (UTC): 2010-2-4 11:41:14
Event ID: fa1ccf8568844a1c97fd4e992b79489e
Event sequence: 4582
Event occurrence: 190
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1461632812/Root-1-129097095032031250
Trust level: Full
Application Virtual Path: /
Application Path: d:/xxweb\
Machine name: WEBSERVER

Process information:
Process ID: 1244
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.

Request information:
Request URL: http://www.xxxxxx.net/Display.aspx?ID=4368
Request path: /Display.aspx
User host address: xx.xxx.xxx.xxx
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 22
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length)
at MySql.Data.MySqlClient.NativeDriver.Query(Byte[] bytes, Int32 length)
at MySql.Data.MySqlClient.Statement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.Execute()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at MySql.Data.MySqlClient.MySqlTransaction.Rollback()
at MySql.Data.MySqlClient.MySqlConnection.Close()
at SXFJ.DAL.main_News.SearchColumnID(String newsID) in d:/xxweb\App_Code\DAL\main_News.cs:line 1397
at Display.BandLink(String id) in d:/xxweb\Display.aspx.cs:line 41
at Display.Page_Load(Object sender, EventArgs e) in d:/xxweb\Display.aspx.cs:line 28
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:

有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
baishi1987 2010-02-09
  • 打赏
  • 举报
回复
我也遇到过这样的问题,估计是哪个页面不符合服务器的要求。
如DLL文件引用,最常见的问题就是你没在.CS文件中引用DLL文件的命名空间
symbol_bc 2010-02-09
  • 打赏
  • 举报
回复
呵呵,说的很明白了,这是一个运行时的错误,而且你肯定不是开发人员,基于安全原因,在远端把错误信息屏蔽了,所以你看不到具体是哪里出错了。
如果这个系统有日志的话,就看日志,没有日志的话,看你可不可以控制服务器,可以的话把
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>这里改为
<customErrors mode="Off" defaultRedirect="mycustompage.htm"/>,就可以看到到底是哪里出的错,可是然后你怎么改啊。难道还要反编译源代码吗?这种时候最好联系写代码的人,要不然你不好搞啊
Snowdust 2010-02-09
  • 打赏
  • 举报
回复
从你提供的东西没法分析,是那个页面,有哪些代码?
symbol_bc 2010-02-09
  • 打赏
  • 举报
回复
没有调试环境,没有上下文,...............................................
yanxiang23 2010-02-09
  • 打赏
  • 举报
回复
求助啊。。。。跪求高手解答

62,046

社区成员

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

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

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

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