This project is read-only.

Unable to add selected webpart - Search Facets: object reference not set on an instance of an object

Sep 19, 2008 at 5:08 PM
Hello to everybody
it took a day to trying to install faceted search..
first I had to undestand that the web.config file that should be manually modified it's the one situated in the wwwroot\wss\virtualdirectory\nnnnn where nnnnn is the number assigned to the central admin site and not the  one referring to the search center site.

Anyway, I'm almost at the end;
in the search result page, in editing mode, when adding a web part i Get this error:
unable to add selected web part(s)
Search facets: Object reference not set to an instance of an object.
When I go in the webpartgallery, I can do a preview of Bread Crumbs, but can't do a preview of Searchfacets.webpart; i get ' An error occured when previewing the web part.' It suggest 'Troubleshoot issues with Windows Sharepoint Services ' and this is useless.
I know that there's other discussion talkin' about this problem. I followed all the proposed solution; no way out. Installed and unistalled Faceted searches 2.5, activated it, eactivated it hundreds of time. No way out
I setted the trust level to Full: still no way out
Setted in elements.xml Ignore IfAlreadyExists to True: again no way out.
I've done
net stop osearch
net start osearch
net stop spsearch
net start spsearch
and guess what? still no way out.

What should I do? Reinstall again ms2008 express? the box is working fine.
Any suggestion?
Best regards to all
Roberto Gerlando
Sep 19, 2008 at 6:16 PM
Edited Sep 19, 2008 at 6:20 PM
Hi Roberto,

Firstly, you should be checking the web.config of the web application where you have Faceted Search installed, not the Central Admin web application.  Also, you should not need to do this if you have deployed Faceted Search via the installer provided, only if you are making modifications.  Can I just check that you are using the out-of-the-box official CodePlex release of Faceted Search 2.5 beta?  And you have made no modifications to the source code?

Shaun O'Callaghan
Sep 20, 2008 at 7:10 AM
Shaun O'Callaghan thank you to spent time helping me
I uninstalled the faceted search, restore the original web.config of the central site (I did a backup); the web config of the search center site was not modified by me.
Installed again faceted search (2.5 beta, last release available), I go in the site setting of the search center, site collection feature, activate the server faceted search web parts, after i Go in the web parts galleryand when I clik on Searchfacets.webpart I still get the error ' an error occured when previewing the web part ' , still something broken; I tried with a little test, to rename  the searchfacets.webpart file in searchfacets.webpartx and when I enable the feature I get ' failed to instantiate file ' searchfacetes.webpart ' from module "faceted search"; source path no found; this means that all is pointing to the right place;
then rename again the file in SearchFacets.webpart; activate the  feature and the status become active; no error showed but when I click to preview the web part or I try to add the fasceted web part to the search result page I get anyway this error ' object reference not set on an instance of an object   '
Sep 20, 2008 at 7:33 AM
I verified that the setup of faceted search is enough to have it installed in the solution management, no needs to modify the web.config file
I want assure you that now the web.config files are now ok and I can assure that i did not mess with them because I had a backup(but in the Faceted Search Setup Guide.Doc file there is write to edit it).
I deleted the search center site and created it again via the application management in central admin site.
Still not working; and I still continue to install/uninstall/activate/deactivate/delete manually the web part/giving full permission and administrator rights to guestes and anomymous and to everybody/iisreset /reset everything/reboot server/ reading word by word the setup guide but still not works :-((((((((((((((((((
thanks for help
Sep 20, 2008 at 11:33 AM
Latest news; the 2.1.0 faceted search works fine; the 2.1.5 don't
Sep 21, 2008 at 9:54 AM
Another thing: the box is a mss2008 Rc, not the RTM version. Could it be this?
Sep 22, 2008 at 2:31 PM
I don't think this is the problem, but to be sure you should always use an RTM version.  Please can you check your event logs/sharepoint logs/SQL logs and see if there are any suspicious errors around the same time?

Shaun O'Callaghan
Nov 3, 2008 at 1:25 PM
Hey folks. I have just had the same problem.
The solution is this:
You must edit the correct web.config file.

My search server is installed at a different port number. This means that I have two different config files to edit:

When I inserted the lines pointet out in the instalation manual, all worked ok.
My setup is Wss3.0 and Search server Express 2008. It works OK.

Karsten Markmann
Dec 1, 2008 at 1:13 PM

I still have the same issue "object reference not set on an instance of an object". I'm using the source code change set 22398.

Please help ;)

Feb 19, 2009 at 10:30 AM
I too have just received the same error.  I'm not sure if it is the same reason for other people but in my case it was due to Faceted Search not being able to connect to the Cache database (I'm not an SQL Expert, I beleive it is due to permissions but don't have time to fix it right now).

It would be good if Faceted search could handle this error, write to the event log with a more usefull message, and still show the web part so that the user can disable the caching if they want to.

As it is I've recompiled the source code with caching property defaulted to off, which has resolved the issue for now.
Feb 19, 2009 at 1:44 PM
Have you tried to disable caching in the web part property?
Feb 19, 2009 at 1:50 PM
The trouble was that I couldn't add the web part to a page in order to disable the cache, so I changed the source code to disable the cache by default.
Feb 19, 2009 at 7:55 PM
You can change default property values by updating searchfacets.webpart definition file located in the SC web part gallery
Dec 14, 2009 at 1:29 PM
leonidly wrote:
You can change default property values by updating searchfacets.webpart definition file located in the SC web part gallery

 How? I don't know the property name to set and theres no sourcecode to check what it's called :(

Dec 14, 2009 at 1:50 PM

.webparts files can be found (and updated) in your Site Collection web part gallery. You don't need to touch any code to update .webpart, these are simple XML. If  needed, check numerous artciles on MSDN wlaking step-by-step on how to update .webpart.

Dec 14, 2009 at 4:28 PM

Hi Leonidly,

I know how to edit the XML files. I just don't know what property to alter. There isn't a property like 'EnableCaching' or something like that in the .webpart file. So I was wondering what line I should add (or edit, but it doesn't seem to be there) to disable caching.

As for the nullreference exception, please check out my own discussion thread, I found some more debug info which is helpfull.

Jan 10, 2010 at 2:43 PM

Leonidly, could you please clarify on how to disable the cache??

Jan 21, 2010 at 2:56 PM

Found the solution, please check out my blog post here:

Jan 21, 2010 at 3:08 PM

I was having problems with this webpart too - then I double-checked that ALL of the *.dll's had been successfully loaded - some weren't. Once I resolved and revisited the steps in the document, I had no issues.