An error occurred when trying to create a controller of type 'Nop.Web.Controllers.CatalogController'. Make sure that the controller has a parameterles

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi

This night we had an error of our site (3.9 version)...it was totally down all the night. Our IT tried to restart the server several time but the site was still down. After they tried to stop the IIS and restarted it after 10 minutes and the site went finally up again. Before the server cpu was 100% and now is less than 10%. Anyone knows what might happened ?

Below the full description of the error:

Tipo  
Errore
Messaggio breve  
An error occurred when trying to create a controller of type 'Nop.Web.Controllers.CatalogController'. Make sure that the controller has a parameterless public constructor.
Messaggio completo  
System.InvalidOperationException: An error occurred when trying to create a controller of type 'Nop.Web.Controllers.CatalogController'. Make sure that the controller has a parameterless public constructor. ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CatalogController (ReflectionActivator), Services = [Nop.Web.Controllers.CatalogController], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CatalogModelFactory (ReflectionActivator), Services = [Nop.Web.Factories.ICatalogModelFactory], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ProductModelFactory (ReflectionActivator), Services = [Nop.Web.Factories.IProductModelFactory], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Riferimento a un oggetto non impostato su un'istanza di oggetto. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CatalogModelFactory (ReflectionActivator), Services = [Nop.Web.Factories.ICatalogModelFactory], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ProductModelFactory (ReflectionActivator), Services = [Nop.Web.Factories.IProductModelFactory], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Riferimento a un oggetto non impostato su un'istanza di oggetto. (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ProductModelFactory (ReflectionActivator), Services = [Nop.Web.Factories.IProductModelFactory], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Riferimento a un oggetto non impostato su un'istanza di oggetto. (See inner exception for details.) ---> System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto. in Autofac.Core.Disposer.AddInstanceForDisposal(IDisposable instance) in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) in Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) in Autofac.Core.Resolving.InstanceLookup.Execute() in Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) in Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) in Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) in Autofac.Core.ResolvedParameter.<>c__DisplayClass5_0`1.<ForKeyed>b__1(ParameterInfo pi, IComponentContext c) in Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() in Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) --- Fine della traccia dello stack dell'eccezione interna --- in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) in Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) in Autofac.Core.Resolving.InstanceLookup.Execute() in Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) in Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() in Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) --- Fine della traccia dello stack dell'eccezione interna --- in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) in Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) in Autofac.Core.Resolving.InstanceLookup.Execute() in Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) in Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() in Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) --- Fine della traccia dello stack dell'eccezione interna --- in Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) in Autofac.Core.Resolving.InstanceLookup.Execute() in Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) in Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) in Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) in Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters) in Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(Type serviceType) in System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) --- Fine della traccia dello stack dell'eccezione interna --- in System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) in System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) in System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) in System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() in System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Thank you
Lorenzo
5 years ago
This must be a modified version of nopCommerce. The error suggests that dependency is not properly registered in codes.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.