Data at the root level is invalid. Line 1, Position 1. when trying to load Sitecore instance with Solr Configuration

924 views Asked by At

I have configured solr in my local machine and it is up and running on the port: 9999 after creating required Solr Cores for Sitecore. Then, I disabled all Lucene config files and enabled all Solr Config files in Include folder. Also, Global.asax is also updated with CastleWindsor solr provider. After making these changes and trying to load my sitecore instance, it threw me the following error:

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

Reference I followed: https://soen.ghost.io/setting-up-solr-for-sitecore-8-x/

Please help me out of this issue.

1

There are 1 answers

0
xmorera On

I have faced this error a few times. The explanation is quite straight forward.

Older versions of Solr use XML as default, while now JSON is the default. Simply add wt=json.

The fix is by adding an extra parameter

param.Add(KV.Create("wt", "xml"));

This has been fixed in SolrNet in newer versions, so pull from NuGet and it sohuld work