6

I'm running Sitecore 8.2 update 4 and SXA 1.3 Update 1. I'm trying to get some custom 404 pages working so that my marketing team can enjoy creating their own 404 pages for each of the sites running on the Sitecore server. I've followed the instructions found here and here, however I'm getting an odd error when I go to a non-existent page.

[NullReferenceException: Object reference not set to an instance of an object.]
   Sitecore.XA.Foundation.LocalDatasources.Pipelines.GetXmlBasedLayoutDefinition.ResolveLocalDatasources.Process(GetXmlBasedLayoutDefinitionArgs args) +85
   (Object , Object[] ) +73
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +478
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +194
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
   Sitecore.Mvc.Pipelines.Response.BuildPageDefinition.ProcessXmlBasedLayoutDefinition.AddRenderings(PageDefinition pageDefinition, BuildPageDefinitionArgs args) +237
   (Object , Object[] ) +73
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +478
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +194
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
   Sitecore.Mvc.Presentation.PageContext.GetPageDefinition() +269
   Sitecore.Mvc.Presentation.PageContext.get_PageDefinition() +30
   Sitecore.Mvc.Presentation.PageContext.GetPageView() +125
   Sitecore.Mvc.Presentation.PageContext.get_PageView() +30
   Sitecore.Mvc.Controllers.SitecoreController.GetDefaultAction() +25
   lambda_method(Closure , ControllerBase , Object[] ) +89

I've looked all over the internet for an answer for how to setup a custom error page using SXA. If I remove the config file that loads the GetXmlBasedLayoutDefintion call, then my 404 page handler resolves fine. I'm sure that there is something that I've missed, but I'd love some help.

| improve this question | | | | |
  • Since you're using SXA, there is OOTB features for Error Handling such as 404 pages. You shouldn't need to add this logic yourself using custom processors. – jammykam Aug 23 '17 at 23:23
  • @jammykam Can you point me to where that documentation lives? I've been trying to figure out how to do that OOTB, but can't find any way to do it. Thanks! – Keith VanderVeen Aug 24 '17 at 14:36
7

Since you are using SXA, the module provides OOTB error handling settings which allow you to set site specific 404 and 500 pages. I couldn't find any linked documention on the Sitecore site but you can set the error pages on the /{tenant/{site}/Settings Item:

SXA Error Handling

These settings are added when you create the tenant, make sure you have selected Error Handling:

SXA Create Tenant

If you have already created the tenant/site but did not select the option then ensure /sitecore/templates/Project/{tenant}/Settings inherits from /sitecore/templates/Feature/Experience Accelerator/Error Handling/_Error Handling.

| improve this answer | | | | |
  • Thanks! I didn't have the Error Handling template included for my site for some reason. I added that as a template, and now it's working. Thanks! – Keith VanderVeen Aug 29 '17 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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