Red Gate forums :: View topic - Internal Server Error - System.NullReferenceException
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Load
ANTS Load forum

Internal Server Error - System.NullReferenceException

Search in ANTS Load forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
calancetech



Joined: 27 Apr 2006
Posts: 1

PostPosted: Thu Apr 27, 2006 3:45 pm    Post subject: Internal Server Error - System.NullReferenceException Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6674

PostPosted: Thu Apr 27, 2006 5:47 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
psabbani



Joined: 25 Apr 2006
Posts: 3

PostPosted: Sat Apr 29, 2006 2:41 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group