3

i encounter this error after changing my search provider from lucene to solr.

Some details:

  • Sitecore 8.1 Update 1
  • Solr 5.2.1
  • Followed sitecore KB article https://doc.sitecore.net/sitecore_experience_platform/80/setting_up_and_maintaining/search_and_indexing/walkthrough_setting_up_solr

  • IOC container choosen : Castle Windsor

  • Followed this article to resolve this issue but still i couldnt get out of this issue https://kb.sitecore.net/articles/227897

    Server Error in '/' Application.
    Object reference not set to an instance of an object.
    
    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.NullReferenceException: Object reference not set to an instance of an object.
    
    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: 
    
    
    [NullReferenceException: Object reference not set to an instance of an object.]
       SolrNet.Schema.SolrSchemaParser.Parse(XDocument solrSchemaXml) +550
       Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +994
       Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169
       (Object , Object[] ) +111
       Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
       Sitecore.Nexus.Web.HttpModule.Application_Start() +227
       Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +673
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
    
2

This is because of your version of Solr. Changes in the default schema.xml file that ship with 4.8+ can cause this issue.

To Resolve this use the following steps:

  1. Make the following changes in the default schema.xml file distributed with Solr:

    • enclose all and elements in the tag.
    • enclose all elements in the tag.
  2. Pass the modified schema.xml file to the Build Solr Schema Wizard to add the Sitecore-specific configuration.

  3. Put the resulting file to the configuration folder of the Solr core.
  4. Find the following dynamic field definition in the schema.xml file:

    <dynamicField name="*_pi" type="pint" indexed="true" stored="true" />

    change the mapping type from "pint" to "tint"

    <dynamicField name="*_pi" type="tint" indexed="true" stored="true" />

  5. Reload the core to apply schema changes.
  6. Restart the application pool of the website to initialize Sitecore indexes using the updated schema.xml file.

This is documented by Sitecore on the Solr Compatibility Table kb article. Please read through that to make sure there are no other compatibility issues with your version of Solr.

3
  • I have done this before & still receiving this error:( i will update the question accordingly. Feb 23 '17 at 5:33
  • People, if you down vote something - add a reason why, maybe the answer can be improved.
    – Richard Seal
    Feb 24 '17 at 16:41
  • Solr is hosted as a windows service & after every change in schema.xml, i'm suppose to restart this service. I was missing this :( Feb 28 '17 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.