3

On a DXA .NET 1.6 website I get this internal server error on a page I just created:

error message

The site.log raises this error which is not very descriptive at first sight:

2016-11-15 11:22:27,335 [32] ERROR - There is an error in XML document (2, 2). System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <html xmlns='http://www.w3.org/1999/xhtml'> was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read32_Page() at Microsoft.Xml.Serialization.GeneratedAssembly.PageSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) at DD4T.Serialization.XmlSerializerService.Deserialize[T](String input) at DD4T.Factories.FactoryBase.AutoDetectSerializerService.Deserialize[T](String input) at DD4T.Factories.PageFactory.GetIPageObject(String pageStringContent) at DD4T.Factories.PageFactory.TryFindPage(String url, IPage& page) at Sdl.Web.Tridion.Mapping.DefaultContentProvider.GetPage(String urlPath, Localization localization) at Sdl.Web.Tridion.Mapping.DefaultContentProvider.GetPageModel(String urlPath, Localization localization, Boolean addIncludes) at Sdl.Web.Mvc.Controllers.PageController.Page(String pageUrl)

1 Answer 1

4

This error occurs when DXA cannot read the page JSON. The trace gives a hint: DD4T.Serialization.XmlSerializerService.Deserialize, DD4T is trying to deserialize the page XML while XML is not expected, DXA publishes pages as JSON.

The problem is that page template or component template are not using a DXA template but a default template from SDL, or another template which does not produce the expected JSON output.

For example: The "Default Page Template" in this screenshot is installed with SDL Web and renders HTML. We should use the Content Page (a standard DXA template) instead. page settings

Btw, this error is not specific to DXA version 1.6 for .NET, since the root of the problem is in the page template used for the page a similar error would occur in other DXA versions and on JAVA.

Your Answer

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

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