I have been lately trying to configure Solr 7.1 with Sitecore 8.2. Once configuration done, after going to content tree, I am getting error "Data at the root level is invalid. Line 1, position 1." In the log file I can see the following :

ERROR Error while instantiating agent. 
      Definition: <agent type="Sitecore.ContentSearch.SolrProvider.Agents.IndexingStateSwitcher, Sitecore.ContentSearch.SolrProvider" method="Run" interval="00:01:00" patch:source="Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />
Exception: System.TypeInitializationException
Message: The type initializer for 'Sitecore.ContentSearch.SolrProvider.Agents.IndexingStateSwitcher' threw an exception.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
   at Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert)
   at Sitecore.Tasks.Scheduler.ReadAgents()

Anybody faced similar issue?

  • 9
    Maybe the problem is that Solr 7.1 is not supported by Sitecore 8.2? kb.sitecore.net/articles/227897
    – Marek Musielak
    Commented Nov 7, 2017 at 7:01
  • 1
    I'm voting to close this question as off-topic because Sitecore version compatibility with SOLR is well known, well documented and already covered multiple times on this site
    – Mark Cassidy
    Commented Jan 8, 2018 at 19:59

4 Answers 4


Data at the root level is invalid. Line 1, position 1


Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)

sounds like Sitecore is not able to read configuration from configuration files. Check, that your SOLR configuration files are valid.


I did run into a similar issue, problem being the configuration file was corrupt/had an unrecognizable character. Please double check your configuration files. Moreover, also take a look at the SOLR compatibility table with sitecore here: https://kb.sitecore.net/articles/227897


Got the same issu with sitecore 9.0 and Solr7.1. Pretty sure i didn't have any unrecognizable character in the files.

I decide to install Solr 6.6.2. No issue, work like a charm! it does not fix your problem with solr7.1 but maybe just confirm a possible incompatibility issue!


Sitecore 8.2 may not be compatible with Solr 7.1 check the link below to see a table of Sitecore versions that work with Solr


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