Error "Data at the root level is invalid. Line 400, position 16"

Topics: Installing Orchard
Oct 23, 2011 at 2:10 PM

I am in the process of upgrading from V1.2 to V1.3.

I get the following error when trying to run the website after finishing all the copying work per the upgrading instructions.  I am wondering if anyone could offer some clue about where I should chase the bug.   

 

Server Error in '/' Application.
--------------------------------------------------------------------------------

Data at the root level is invalid. Line 400, position 16.
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 400, position 16.

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 400, position 16.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +73
   System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +122
   System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +4114669
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +189
   System.Xml.XmlTextReaderImpl.Read() +145
   System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) +891
   System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) +42
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +280
   System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options) +83
   Orchard.FileSystems.Dependencies.DefaultDependenciesFolder.ReadDependencies(String persistancePath) in d:\Builds\OrchardFull\src\Orchard\FileSystems\Dependencies\DefaultDependenciesFolder.cs:63
   Orchard.FileSystems.Dependencies.DefaultDependenciesFolder.<LoadDescriptors>b__3(AcquireContext`1 ctx) in d:\Builds\OrchardFull\src\Orchard\FileSystems\Dependencies\DefaultDependenciesFolder.cs:40
   Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in d:\Builds\OrchardFull\src\Orchard\Caching\Cache.cs:57
   Orchard.Caching.<>c__DisplayClass2.<Get>b__0(TKey k) in d:\Builds\OrchardFull\src\Orchard\Caching\Cache.cs:19
   System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory) +125
   Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in d:\Builds\OrchardFull\src\Orchard\Caching\Cache.cs:17
   Orchard.Caching.DefaultCacheManager.Get(TKey key, Func`2 acquire) in d:\Builds\OrchardFull\src\Orchard\Caching\DefaultCacheManager.cs:33
   Orchard.FileSystems.Dependencies.DefaultDependenciesFolder.LoadDescriptors() in d:\Builds\OrchardFull\src\Orchard\FileSystems\Dependencies\DefaultDependenciesFolder.cs:35
   Orchard.Environment.Extensions.ExtensionLoaderCoordinator.CreateLoadingContext() in d:\Builds\OrchardFull\src\Orchard\Environment\Extensions\ExtensionLoaderCoordinator.cs:194
   Orchard.Environment.Extensions.ExtensionLoaderCoordinator.SetupExtensions() in d:\Builds\OrchardFull\src\Orchard\Environment\Extensions\ExtensionLoaderCoordinator.cs:55
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in d:\Builds\OrchardFull\src\Orchard\Environment\DefaultOrchardHost.cs:101
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in d:\Builds\OrchardFull\src\Orchard\Environment\DefaultOrchardHost.cs:67
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in d:\Builds\OrchardFull\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in d:\Builds\OrchardFull\src\Orchard.Startup\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in d:\Builds\OrchardFull\src\Orchard.Startup\Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in d:\Builds\OrchardFull\src\Orchard.Web\Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

Oct 28, 2011 at 2:21 AM

The upgrading has finally worked, however I have lost the capability of having a local development copy of Orchard due the aforementioned error.  

I have exhausted my imagination in creating a working local copy of my Orchard instance. I used to have one.  I always get this error.  I have duplicated everything on the server that I can think of related Orchard. 

After giving up creating a local copy, I followed the upgrading instructions to work on the server. Suppose the concerned website resides in folder C:\foo, I created C:\fooupgrade to test.  The error still occurred for the test app. Out of curiosity, I renamed C:\foo to C:\foo1, and made IIS point to C:\foo1.  Now the same error occurred for the instance of Orchard that was working.

In summary, this particular instance of Orchard works only if C:\foo on the server is used as its directory. 

Oct 30, 2011 at 1:19 AM

I have finally managed to have a working local copy again, After the instance on the server started to function normally, I downloaded the entire Orchard folder to a local machine running Win7 Ultimate 64-bit. It generated the same error initially. After making some changes on IIS and the directory, it suddenly started working.  Unfortunately, I do not know exactly which of the changes that I took has made it work, or it has anything to do with the changes.

Oct 30, 2011 at 1:20 AM

I have finally managed to have a working local copy again, After the instance on the server started to function normally, I downloaded the entire Orchard folder to a local machine running Win7 Ultimate 64-bit. It generated the same error initially. After making some changes on IIS and the directory, it suddenly started working.  Unfortunately, I do not know exactly which of the changes that I took has made it work, or it has anything to do with the changes.