4

I've installed Sitecore 8.2 Original release, and then Ran the Sitecore Powershell Extensions-4.3 for Sitecore 8 and the Sitecore Experience Accelerator 1.2 rev. 161216 onto the instance. That all seems to work just fine. However, the problem comes when I convert my site to run on SOLR. As soon as I do this I get a SOLR Error. Here's what I get:

Server Error in '/' Application.

Could not create instance of type: Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex. No matching constructor was found.

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: Sitecore.Exceptions.ConfigurationException: Could not create instance of type: Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex. No matching constructor was found.

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: 


[ConfigurationException: Could not create instance of type: Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex. No matching constructor was found.]
   Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +291
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +932
   Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +560
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +322
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +266
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +92
   Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +255
   (Object , Object[] ) +71
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +259
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
   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

[HttpException (0x80004005): Could not create instance of type: Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex. No matching constructor was found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712

If I switch back to Lucene, everything works fine. However, my production environment (and my test environments) are all SOLR, so I need to be able to use SXA in a SOLR environment. What am I missing?

5
  • Exactly which configuration files you enabled to switch SOLR? Jan 30, 2017 at 20:58
  • I ran a powershell script that I found that disables all config files that have lucene in the file name and enables all config files that have SOLR in them. Jan 30, 2017 at 21:04
  • 1
    Do you have the Sitecore.ContentSearch.SolrCloud.SwitchOnRebuild.config.example enabled? Jan 31, 2017 at 12:35
  • 1
    That was the problem! @TamásTárnok if you'd like to post that as the answer, I'd be glad to accept it. Automation is good, but only when it works! Thanks again! Jan 31, 2017 at 20:54
  • I will transfer to answer then :) Jan 31, 2017 at 22:12

2 Answers 2

5

The problem could be that the Powershell script which is enabling all Solr configuration files. You have to be careful because if you are using a regex for that (all files which name contains "Solr") then it is also enabling Sitecore.ContentSearch.SolrCloud.SwitchOnRebuild.config.exam‌​ple. This should be disabled if you did not configure it.

2

The Could not create instance of type: Sitecore.XA.Foundation.Search.Providers.Solr.SolrSearchIndex. No matching constructor was found. means that there SXA Solr Provider configuration file contains:

  • configuration of an index which doesn't exist (in most cases this is the case as we ship just an example Solr configuration file)
  • configuration of and index with wrong number of constructor parameters

I would suggest to go one by one and remove indexes from Sitecore.XA.Foundation.Search.Solr.config configuration file and check if this will help.

3
  • I was able to see that if I comment out the sitecore_core_index, sitecore_master_index, and sitecore_web_index, then I don't get the error anymore. However, it also looks like I might not get any kind of indexing on my database. So it looks like the problem might be your 2nd option. Jan 30, 2017 at 21:26
  • I don't think that it's about those 3. In Sitecore.XA.Foundation.Search.Solr.config we ship much more of them. Jan 31, 2017 at 5:48
  • In my case I simply needed to patch remove the indexes that I'm not using by adding a file in z.Foundation.Overrides in a folder so the patching would run after the Sitecore.XA.Foundation.Search.Solr.config. Mar 28, 2017 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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