Event ID: 1309, Event Code: 3005

ndecker_aquatech
ndecker_aquatech used Ask the Experts™
on
Hi Experts,
I've got a 2003 R2 Server running multiple websites.  Sites are all attached to a SQL instance on another box.  I get the following error every couple minutes:
Event Type:      Warning
Event Source:      ASP.NET 2.0.50727.0
Event Category:      Web Event
Event ID:      1309
Date:            10/20/2010
Time:            11:19:59 AM
User:            N/A
Computer:      AQUACOMM
Description:
Event code: 3005  Event message: An unhandled exception has occurred.  Event time: 10/20/2010 11:19:59 AM  Event time (UTC): 10/20/2010 6:19:59 PM  Event ID: 9ea46124f0d0414982d20bbe57f643f8  Event sequence: 6932  Event occurrence: 984  Event detail code: 0    Application information:      Application domain: /LM/W3SVC/980502082/Root-6-129319981714908745      Trust level: Full      Application Virtual Path: /      Application Path: C:\Inetpub\Websites\Aquatech\      Machine name: AQUACOMM    Process information:      Process ID: 6840      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:       Request path:       User host address:       User:       Is authenticated: False      Authentication Type:       Thread account name: AQUATECH\dreidy    Thread information:      Thread ID: 7      Thread account name: AQUATECH\dreidy      Is impersonating: False      Stack trace:    at website.Global.getCurrentCookie()
   at website.Global.Session_End(Object sender, EventArgs e)
    Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Any help is greatly appreciated!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
In the Aquatech web application, look at the Session_End method in Global.asax.  Looks like it makes a call to getCurrentCookie(), and in that method there is a null reference.  Look for a place where a method or property is used on an object that hasn't been initialized.  If you want, you can post the code to the getCurrentCookie method.

Author

Commented:
Hi ChetOS82,
I don't know if i have access to the actual code.  I'm not a developer per se. The only line in the Global.asax is:
<%@ Application Codebehind="Global.asax.cs" Inherits="website.Global" %>

Where would I look for the getCurrentCookie code?

Commented:
Sorry, look at the code behind for the Global.asax file, it is called Global.asax.cs
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Author

Commented:
Oddly enough there is no Global.asax.cs file anywhere to be found.  Could this:
<%@ Application Codebehind="Global.asax.cs" Inherits="website.Global" %> found inside my Global.asax file be referencing a Global.asax.cs contained within a dll or something?  Because there is no website.Global file either.

Commented:
Is there a website.dll in the Bin directory?

Author

Commented:
Yes

Author

Commented:
How can I view the contents of that dll?  Can you recommend a dll viewer or dissassembly tool?

Commented:
Reflector

Commented:
http://www.red-gate.com/products/reflector/

Open the dll in that program, then expand the tree until you find a class called Global.  In there you should see a line "Session_End(Object, EventArgs) : Void".  Double-click that and you will see the code.  In there, you will see a method call to getCurrentCookie().  Click that and it will take you to the code for that method.

Commented:
Have a read here too. That's what fixed the error for me on 2k3 with SQL 2k5

http://forums.asp.net/p/1025914/1397968.aspx

Author

Commented:
Chet:
This the code in the Session_End(Object, EventArgs) : Void object:
protected void Session_End(object sender, EventArgs e)
{
    this.doUpdate("delete from asBookings where exists (select * from carts c inner join cartitems i on c.id=i.cartid where c.usersession='" + this.getCurrentCookie().Replace("'", "''") + "' and i.openingid=asBookings.openingid and asBookings.cartid=c.id);delete from cartitems where openingid>0 and exists (select * from carts where carts.id=cartitems.cartid and usersession='" + this.getCurrentCookie().Replace("'", "''") + "')");
    if (((int) base.Session["userlogin"]) == 0)
    {
        this.doUpdate("update cbLog set sessionlive=0 where cookie='" + this.getCurrentCookie().Replace("'", "''") + "'");
    }
    else
    {
        this.doUpdate(string.Concat(new object[] { "update cbLog set sessionlive=0 where cookie='", this.getCurrentCookie().Replace("'", "''"), "' or memberid=", (int) base.Session["userlogin"] }));
    }
}

Do you see any errors in this?  
Commented:
The problem is in the this.getCurrentCookie method.  You should see that as well in Reflector.  In fact, if you click on the word "getCurrentCookie" it will take you to that method.

Also, just to be clear up front, there is no way you can fix this on your own.  The developer is going to need to make the change, recompile, and redeploy.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial