Internal Server Error - System.NullReferenceException

Forum for users of ANTS web server load testing tool

Moderator: Brian Donahue

Internal Server Error - System.NullReferenceException

Postby calancetech » Thu Apr 27, 2006 3:45 pm

Hi,
I m trying to load test a .NET web app. I get an Internal Server Error when the script is executed.

Item http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67 ASP.NET HTML content <html> <head> <title>Object reference not set to an instance of an object.</title> <style> body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px} b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red } H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:\"Lucida Console\";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head> <body bgcolor=\"white\"> <span><H1>Server Error in '/eCPWeb' Application.<hr width=100% size=1 color=silver></H1> <h2> <i>Object reference not set to an instance of an object.</i> </h2></span> <font face=\"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif \"> <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br><br> <b> Exception Details: </b>System.NullReferenceException: Object reference not set to an instance of an object.<br><br> <b>Source Error:</b> <br><br> <table width=100% bgcolor=\"#ffffcc\"> <tr> <td> <code> An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code> </td> </tr> </table> <br> <b>Stack Trace:</b> <br><br> <table width=100% bgcolor=\"#ffffcc\"> <tr> <td> <code><pre> [NullReferenceException: Object reference not set to an instance of an object.] eCarePro.eCPWeb.Global.Session_Start(Object sender, EventArgs e) +21 System.Web.SessionState.SessionStateModule.CompleteAcquireState() +525 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +698 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +66 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +173 </pre></code> </td> </tr> </table> <br> <hr width=100% size=1 color=silver> <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 </font> </body> </html> <!-- [NullReferenceException]: Object reference not set to an instance of an object. at eCarePro.eCPWeb.Global.Session_Start(Object sender, EventArgs e) at System.Web.SessionState.SessionStateModule.CompleteAcquireState() at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) at System.Web.AsyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->


Following is the script:
Public Class BrowserClient1
Inherits Control.VirtualClient

Protected Overrides Sub Run()
' Script created with Internet Explorer on 4/27/2006 8:01:59 PM

' Random pause of between and 1 and 2 seconds
' (Remove this line if you want all scripts to start at the same time)
RandomSleep(1000, 2000)

WebClient.HttpRequest.ProtocolVersion = \"HTTP/1.1\"
BeginPage(\"http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67\")
WebClient.HttpRequest.UserAgent = \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\"
WebClient.GET(\"http://ajay/eCPWeb/secure/UserControls/images/trans.gif\")
WebClient.GET(\"http://ajay/ecpweb/secure/images/trans.gif\")
EndPage(\"http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67\")
' End of page 1 contains 2 request(s).

Sleep(6213)
BeginPage(\"http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67\")
WebClient.HttpRequest.Pragma = \"no-cache\"
WebClient.HttpRequest.ContentType = \"application/x-www-form-urlencoded\"
WebClient.HttpRequest.AddPostData(\"__EVENTTARGET\", \"\", False)
WebClient.HttpRequest.AddPostData(\"__EVENTARGUMENT\", \"\", False)
WebClient.HttpRequest.AddPostData(\"__VIEWSTATE\", WebClient.ViewState, False)
WebClient.HttpRequest.AddPostData(\"loginCtrlObj%3AtxtUsername\", \"idc@calance.com\", False)
WebClient.HttpRequest.AddPostData(\"loginCtrlObj%3AtxtPassword\", \"welcome\", False)
WebClient.HttpRequest.AddPostData(\"loginCtrlObj%3AImgBtnLogin.x\", \"0\", False)
WebClient.HttpRequest.AddPostData(\"loginCtrlObj%3AImgBtnLogin.y\", \"0\", False)
WebClient.POST(\"http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67\")
WebClient.HttpRequest.ContentType = Nothing
WebClient.GET(\"http://ajay/ecpweb/Common/Home.aspx?CurrPgId=100\")
WebClient.HttpRequest.Pragma = Nothing
WebClient.GET(\"http://ajay/eCPWeb/common/UserControls/images/trans.gif\")
EndPage(\"http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67\")
' End of page 2 contains 3 request(s).

Sleep(5604)
BeginPage(\"http://ajay/eCPWeb/common/page.aspx?currPgId=60&logOffStatus=1\")
EndPage(\"http://ajay/eCPWeb/common/page.aspx?currPgId=60&logOffStatus=1\")
' End of page 3 contains 0 request(s).

' End of script contains 3 page(s).


End Sub
End Class

Kindly help me out.

Thanks.
calancetech
 
Posts: 1
Joined: Thu Apr 27, 2006 3:38 pm

Postby Brian Donahue » Thu Apr 27, 2006 5:47 pm

Hello,

This is probably another inconsistent viewstate problem. Please try this:
[code]Public Class BrowserClient1
Inherits Control.VirtualClient

Protected Overrides Sub Run()
' Script created with Internet Explorer on 4/27/2006 8:01:59 PM

' Random pause of between and 1 and 2 seconds
' (Remove this line if you want all scripts to start at the same time)
RandomSleep(1000, 2000)

WebClient.HttpRequest.ProtocolVersion = "HTTP/1.1"
BeginPage("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
WebClient.HttpRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
WebClient.GET("http://ajay/eCPWeb/secure/UserControls/images/trans.gif")
WebClient.GET("http://ajay/ecpweb/secure/images/trans.gif")
WebClient.GET("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
EndPage("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
' End of page 1 contains 2 request(s).

Sleep(6213)
BeginPage("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
WebClient.HttpRequest.Pragma = "no-cache"
WebClient.HttpRequest.ContentType = "application/x-www-form-urlencoded"
WebClient.HttpRequest.AddPostData("__EVENTTARGET", "", False)
WebClient.HttpRequest.AddPostData("__EVENTARGUMENT", "", False)
WebClient.HttpRequest.AddPostData("__VIEWSTATE", WebClient.ViewState, False)
WebClient.HttpRequest.AddPostData("loginCtrlObj%3AtxtUsername", "idc@calance.com", False)
WebClient.HttpRequest.AddPostData("loginCtrlObj%3AtxtPassword", "welcome", False)
WebClient.HttpRequest.AddPostData("loginCtrlObj%3AImgBtnLogin.x", "0", False)
WebClient.HttpRequest.AddPostData("loginCtrlObj%3AImgBtnLogin.y", "0", False)
WebClient.POST("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
WebClient.HttpRequest.ContentType = Nothing
WebClient.GET("http://ajay/ecpweb/Common/Home.aspx?CurrPgId=100")
WebClient.HttpRequest.Pragma = Nothing
WebClient.GET("http://ajay/eCPWeb/common/UserControls/images/trans.gif")
EndPage("http://ajay/ecpweb/secure/eCPLogin.aspx?CurrpgId=67")
' End of page 2 contains 3 request(s).

Sleep(5604)
BeginPage("http://ajay/eCPWeb/common/page.aspx?currPgId=60&logOffStatus=1")
EndPage("http://ajay/eCPWeb/common/page.aspx?currPgId=60&logOffStatus=1")
' End of page 3 contains 0 request(s).

' End of script contains 3 page(s).
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby psabbani » Sat Apr 29, 2006 2:41 pm

This may be a problem with some language support. Please try to add this statement

WebClient.HttpRequest.AcceptLanguage = "us-en"

right after

WebClient.HttpRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

Hope this helps. Good Luck!
psabbani
 
Posts: 3
Joined: Tue Apr 25, 2006 6:09 pm


Return to ANTS Load

Who is online

Users browsing this forum: No registered users and 0 guests