Related Tags:
C# C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. Learn More, ASP.NET MVC The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly. Learn More, CMS A content management system (CMS) is a software application or set of related programs that are used to create and manage digital content. CMSes are typically used for enterprise content management (ECM) and web content management (WCM) Learn More, Sitecore Sitecore is one of the leading enterprise-level content management systems built on ASP.NET, enabling web content editors and marketers to have full control over all aspects of their website from social integration and blog posts to advanced personalisation, e-commerce and more. Launched in 2001, Sitecore has used the .NET platform from the beginning of the language itself, and has been growing in popularity over the last few years. Currently on its 7th major version, it now runs on .NET 2.0/4.0, and the core has been rewritten from scratch to take advantage of the improvements made in ASP.NET 4.5. Learn More, IIS (Internet Information Services) IIS Stands for "Internet Information Services." IIS is a web server software package designed for Windows Server. It is used for hosting websites and other content on the Web. Microsoft's Internet Information Services provides a graphical user interface (GUI) for managing websites and the associated users. Learn More, Sitecore 9 Sitecore is a Web Content Management System (CMS) built on Microsoft This tag is for sitecore version 9. Learn More,

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

Description:I am getting following error on a website developed using sitecore 9 and already hosted on my local environment and was working until I have just installed another instance of website using sitecore 9.1 the site previously working fine,started throwing following error.

Server Error in '/' Application.
Data at the root level is invalid. Line 1, position 1.
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.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

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:

[XmlException: Data at the root level is invalid. Line 1, position 1.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +88
System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +6683419
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +336
System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +60
System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) +147
SolrNet.Impl.SolrCoreAdmin.Status() +67
Sitecore.ContentSearch.SolrProvider.SolrStatus.OkSolrStatus() +73
Sitecore.ContentSearch.SolrProvider.SolrStatus..cctor() +72

[TypeInitializationException: The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.]
Sitecore.ContentSearch.SolrProvider.SolrStatus.SetIndexForInitialization(ISearchIndex solrIndex) +0
Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.SetForReinitialization() +202
Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.InitializeSolr() +129
Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +46
Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169
Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +913
(Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +469
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +161
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +764
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +570
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +169
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329

[HttpException (0x80004005): The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2633.0

Posted by: | Posted on: Jul 31, 2019

1 answers



It seems solr version compatibility issue because sitecore 9 and sitecore 9.1 are compatible with different solr version. for solr version compatibility you can review following sitecore solr compatibility chart .
But you can easily resolve your issue by just enabling your compatible solr version,i.e sitecore 9 is compatible with solr 6.6.2 so you just need to open your local services and stop the other solr version(solr-7.2.1) and start solr-6.6.2 screenshot for your reference. then just restart your site it will be working fine.

Replied by: | Replied on: Aug 02, 2019


Code block Hyperlink bold Quotes block Upload Images