Roland Oldengarm - Independent IT Contractor

Living in the coolest little capital Wellington, New Zealand!

Contentbyquerywebpart, displaying value of Associated Lookupfield: “Attempted to use an object that ceased to exist”

The case: The customer wants to create news pages and select a category out of a dropdown. Each category has an associated image which has to be shown in an overview. No code allowed. Thus, lookup list, contentbyquerywebpart, image library, should work like a charm… But, no…

Thus, I created a list “Categories” with 2 columns “Title” and “Image URL”, an image library with the icons, I filled the list and aa contenttype which inherits from Article Page with a lookup field to the list Categories. The lookup field displays “Title”, but I selected to copy “Image URL” also, because I had to display that URL in the overview.

I modified an existing Page Layout to be associated with the new contenttype and created a news page. Because the lookup field was required, after publishing the properties screen came up. I could select the category. Really nice till now.

Then, I added a ContentByQueryWebPart and selected to show items from the news site and sites below (2nd option in query selection). Then, only show the news contenttype and under Presentation I replace “overview image” by the name of the associated lookup field (e.g. “Category: Image URL”). After publishing the webpart, I got the error “Attemted to use an object that ceased to exist”. In the stacktrace no sign of the contentbyquerywebpart. Google showed me no results either.

Tried a lot of things, but nothing worked. Until I changed the query selection to only display one list… After that, it worked… Changing it back to get data from site and subsites:

Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))

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.Runtime.InteropServices.COMException: Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED)) Source Error: 
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.
 Stack Trace: 
[COMException (0x80030102): Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))]
   Microsoft.SharePoint.Library.SPRequestInternalClass.GetWebUrl(Guid gWebId, String bstrSiteUrl) +0
   Microsoft.SharePoint.Library.SPRequest.GetWebUrl(Guid gWebId, String bstrSiteUrl) +157

[SPException: Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))]
   Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +27434242
   Microsoft.SharePoint.Library.SPRequest.GetWebUrl(Guid gWebId, String bstrSiteUrl) +243
   Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint) +180
   Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId) +34
   Microsoft.SharePoint.Publishing.CachedArea.GetIdentityWeb(Guid webId, SPSite elevatedSite, Boolean isSuperUser) +248
   Microsoft.SharePoint.Publishing.CachedArea.GetChildListByUrl(String listurl) +213
   Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.QuickDeployAction.IsCurrentlyEnabled(AuthoringStates currentState) +267
   Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ConsoleAction.OnPreRender(EventArgs e) +136
   System.Web.UI.Control.PreRenderRecursiveInternal() +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

When I try to select the “direct lookup” (thus, Category), it works fine. Strange….

Leave a Reply

Your email address will not be published.

*