Wednesday, March 26, 2008

The mysterious 0x80020009 Error

This time we have to deal with a tough boy! The error has probably something to do with disposing of objects...

I wrote a contact webpart, who has several custom properties to set the labels and some other info (SMTP Server name, Success Message, etc.). When I added my new webpart to the page and set the properties - everything works fine. But... when I modified the text of a label, I got the following error message:

Cannot save the property settings for this Web Part. Exception occurred.
(Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))

The first thing you do when you see an error like that is to verify the ULS Logs and take a look at the eventviewer. The eventviewer indicated no problem.

The ULS Log gave me the following message:

Trying to store a checked out item (/page.aspx) in the object cache. This may be because the checked out user is accessing the page, or it could be that the SharePoint system account has the item checked out. To improve performance, you should set the portalsuperuseraccount property on the web application. See the documentation for more information.

So I:
--- removed the webpart
--- added him back to the page
--- modified the custom properties ... works ok (surprisingly!)
--- a couple of hours later... modified it ... didn't work anymore!

I haven't found a solution for it...
Hezser talked about disposing SP objects correctly - but in my webpart I don't use SPWeb, SPSite, etc... . I'll update this post when I get more information.

Worth to mention: The same webpart and thus the same code works fine on my developing machine. Spooky!

Hezser blog (Dispose SP objects correctly)
Paul Gavin's SharePoint Space (no solution yet)

Update: I discovered that my custom webpart is not the only victim. Other webparts are poisoned as well.

Solution: My "innocent" label was the cause of the problem. See my next post about "unable to add selected webpart".

1 comment:

steve h said...


I am a sharepoint dev. I just had this error reported to me by a user of one of my sites.

It was raised when they add a percent symbol to an infopath rich text control rendered by infopath forms services!