Locally perfect working project seems to fail at remote machine
I have a project developed under Microsoft Visual Studio 2005 (with full updates), ASP.NET. The software uses a remote database to retrieve data. At the development process everything went fine. The project was working perfectly. But after installing publishing the project and adding the files to the web server the project seem to fail randomly. Even if I try to perform the same error on my machine to debug it just sems OK and no error occurs. My director advised me to close the connections after SQL queris and told me that it might cause the error so I have done it as:
Now when I try the same project again at the web server everythinh works fine for a moment and then fails for another moment. I have tried to figure out the reason or kind of error. But at a point when the project falls to error it simply might not on the next try. There are just a few clues to figure out what the problem is. First when a first kind of error happens I get the following message:
Server Error in '/bookings' Application.
Object reference not set to an instance of an object. Description: 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.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
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.
[NullReferenceException: Object reference not set to an instance of an object.]
frmBrandOwner.Page_Load(Object sender, EventArgs e) +403
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Another thing is that the program redirecs itself to the error page I made. But when I check the pages there only one point that it might be redirected to the error page. At the Loads event of every page I check the user login status and administration rights. To do so;
1. Check the user login:
a. Check if the session exists
b. Check if the session[username] exists
a. Check if the cookie exists
should be verified. At the administration rights section I am simply checking if the user level that is held in the session is smaller than a certain value in a DataHolder class which only holds private static data and updates itself while running at the first run of the program. So, it seems that the program might only fail if it does not read from the calss DataHolder, but since the project is on the remote machine when it causes the error, I can not debug it and it does not cause any problems while running locally.
Can anybody help me on solving the issue?
Utku Ozan ÇANKAYA
Most probably you have hardcoded ipaddress or using localhost than using actual ip addreeses in your code.
By mannuvashishta in forum .NET
Last Post: 04-06-2007, 01:47 PM
By naijacoder in forum ASP.NET
Last Post: 08-21-2006, 03:39 AM
Last Post: 06-03-2003, 09:33 AM
By Glenn McKee in forum Careers
Last Post: 08-24-2000, 10:51 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL