SharePoint Users Group > SharePoint Blogs > SharePoint is Flowers and Rainbows and Unicorns
Diagnosing and Fixing a broken bdc field 
  • Currently rated 5/5

One of our clients reported that after updating several items in a list with a BDC column everything seemed to break. They could still view the information since it is stored in the list item, however they could not add new or edit existing items in the list as the field was required. The list contained over 49,000 items (in folders) so recreating the list/field was not really an option. Without knowing the exact reason, it was determined that three fields within the BusinessDataField had been unset. These fields were: SystemInstanceName, EntityName, and BdcFieldName. Essentially the link had been broken back to the bdc. The solution, outlined below, was to update the field instance with the correct values.

The method used to determine the problem and fix it is fairly straightforward:

  1. Find the error in the 12 hive logs, in our case it was this:
    System.ArgumentOutOfRangeException:   Parameter name: name     at Microsoft.Office.Server.ApplicationRegistry.MetadataModel.ApplicationRegistry.GetLobSystemInstanceByName(String name)...
    
  2. Open reflector to the application registry object and examine the GetLobSystemInstanceByName method
    1. You will see that what throws that exception is if the name is either empty of longer than 255 characters
    2. This tells us that something is wrong with the SystemInstanceName property of that field in that list
  3. Add a new BDC field to the list for the appropriate entity that is “broken”
  4. Run the below code for both fields (or have it do both at once)
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPList list = null;
    
        using (SPSite site = new SPSite("{siteURl}"))
        {
            using (SPWeb web = site.OpenWeb())
            {
                try
                {
                    list = web.Lists[new Guid("{listguid}")];
                }
                catch { }
            }
            site.RootWeb.Dispose();
    
            if (list != null)
            {
                BusinessDataField field = (BusinessDataField)list.Fields["{FieldName}"];
    
                if (field != null)
                {
                    Type t = field.GetType();
                    List<PropertyInfo> props = new List<PropertyInfo>(t.GetProperties());
    
                    props.ForEach(delegate(PropertyInfo p)
                    {
                        this.Cout(p.Name, p.GetValue(field, null));
                    });
                }
            }
        }
    });
  5. Note what fields are incorrect or empty between the two outputs, in this case SystemInstanceName, EntityName, and BdcFieldName and note the correct values
  6. Run the below code up update the field with the appropriate values
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPList list = null;
    
        using (SPSite site = new SPSite("{siteURl}"))
        {
            using (SPWeb web = site.OpenWeb())
            {
                try
                {
                    list = web.Lists[new Guid("{listguid}")];
                }
                catch { }
            }
            site.RootWeb.Dispose();
    
            if (list != null)
            {
                BusinessDataField field = (BusinessDataField)list.Fields["{FieldName}"];
    
                if (field != null)
                {
                    field.SystemInstanceName = "{lob system instance name}";
                    field.EntityName = "{entity name}";
                    field.BdcFieldName = "{bdc field name}";
                    field.Update();
                    list.Update();
                }
            }
        }
    });
  7. Test to ensure that functionality has returned
  8. Delete column you created in step 1
Foxit x64 IFilter for Full Text Indexing of PDF files 

Recently a client requested we install an ifilter allowing for full text indexing of pdf files. Overall a fairly simple process, however the server was x64. Having had success with the x86 Adobe filter I started there, however after trying several times and failing with the beta x64 filter we turned to the Foxit filter. It worked great and after a full crawl the pdf files are now properly indexed.

Instructions and pricing are contained on the site. And no, I am in no way affiliated with Foxit, its just nice to recognize a company that developed a nice product.

http://www.foxitsoftware.com/pdf/ifilter/

Site collection usage reports not visible. 

After an upgrade from wss 3.0 to MOSS the Site collection usage reports link was not available to site collection administrators in Site Settings.  The fix was easy, ensure that the "Office SharePoint Server Standard Site features" feature is activated at the site level.

Once active the link appeared, however with the farm account I received access denied messages and something was killing the entire application pool. Checking the event log I found:

NET Runtime version 2.0.50727.42 - Fatal Execution Engine Error (7A05E2B3) (80131506)

That exception is the entire .net2 framework crashing down. Good stuff. After some looking around I found this hotfix. The issue is described as:

When the common language runtime (CLR) starts, the CLR verifies that the user profile exists. If the user profile does not exist, a null reference is put in the user policy cache. If the user profile is created during policy resolution, the CLR tries to remove the reference to the null reference in the user policy cache. When the CLR cannot remove the reference to the null reference in the user policy cache, the .NET Framework 2.0 crashes.

We are holding off on applying the hotfix because the issue seems to only occur with the farm account right now, all normal user accounts seem to be fine and can properly view usage statistics. As with any hotfix all the usual warnings apply so please don't apply anything without testing first.

1 - 3 Next

 ‭(Hidden)‬ Admin Links

 Patrick Rodgers

  My photos on Picasa
  Blog Archive
  Blog Archive (calendar view)
  Data Object Provider on CodePlex

 Tag Cloud

 Last 15 SUG Posts

Posted by sug:nigel_witherdin@hotmail.com on 2008-11-10 10:35:34.
Posted by Kyle Schaeffer on 2008-11-10 09:35:41.
Posted by lisa melito on 2008-11-06 20:34:10.
Posted by Sean Bordner on 2008-10-24 15:05:13.
Posted by Ann Wallinger on 2008-10-23 18:40:13.
Posted by Kyle Schaeffer on 2008-10-16 17:10:51.
Posted by Ann Wallinger on 2008-10-16 13:31:55.
Posted by Ann Wallinger on 2008-10-14 22:04:53.
Posted by Ann Wallinger on 2008-10-08 23:58:08.
Posted by Sean Bordner on 2008-10-06 18:46:54.
Posted by Kyle Schaeffer on 2008-10-06 10:50:01.
Posted by Ann Wallinger on 2008-10-03 14:41:55.
Posted by Ann Wallinger on 2008-10-03 14:36:15.
Posted by Ann Wallinger on 2008-10-03 14:33:18.
Posted by Tim Dobrinski on 2008-10-01 12:24:17.
Other Blogs
There are no items in this list.
powered by Microsoft Office SharePoint Server 2007