I am getting the below error once I installed the Sitecore JSS server packages Preview 4. I have follwed the same steps mentioned in https://jss.sitecore.net/docs/getting-started/jss-server-install

The controller for path '/sitecore/api/layout/render/jss' was not found or does not implement IController.

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: Sitecore.Mvc.Diagnostics.ExceptionWrapper: The controller for path '/sitecore/api/layout/render/jss' was not found or does not implement IController.

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:

[ExceptionWrapper: The controller for path '/sitecore/api/layout/render/jss' was not found or does not implement IController.]

[ControllerCreationException: Could not create controller: 'LayoutService'. The context item is: '/sitecore/content/Careers/Home'. The current route url is: 'sitecore/api/layout/{action}/{configuration}'. ]
Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +172
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +268 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +95
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +923 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

  • A few questions: What version of Sitecore are you using? Do you have any other modules installed? Where/how are you encountering this error, e.g. are you browsing directly to the layout service endpoint (as the docs suggest) or are you seeing this error in some other context? – Adam Weber Sep 14 at 11:19
up vote 1 down vote accepted

It sounds like some kind of custom routing setup may be conflicting with Layout Service's routing registration.

Layout service (App_Config/Sitecore/LayoutService/*.config) patches its route registrations after the Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc pipeline processor, so if some other custom routing causes this patch to fail, the LS route may not be registered correctly.

Using the /sitecore/admin/showconfig.aspx page will let you diagnose this issue and see the interactions between custom routing. If the Sitecore.LayoutService.Mvc.Pipelines.Initialize.RegisterRoutes, Sitecore.LayoutService.Mvc pipeline processor does not go before the InitializeRoutes pipeline processor, the LS will not register correctly.

  • I am seeing the Sitecore.LayoutService.Mvc.Pipelines.Initialize.RegisterRoutes, Sitecore.LayoutService.Mvc pipeline registered before InitializeRoutes pipeline processor. But I am still have the issue. – Prabhu Sep 14 at 9:10
  • Is this a fresh Sitecore installation or an existing installation with customizations? Try removing customizations and re-adding them to isolate the one causing issues. – Kam Figy Sep 14 at 14:49
  • It is a fresh installation of Sitecore 9 version. But, I have done few customization before I install this package. Let me try your suggestion and keep you posted. Thanks for the feedback – Prabhu Sep 17 at 6:33
  • It worked now after i had removed my custom configs and DLLs. Thanks – Prabhu Sep 17 at 13:37

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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