Getting some errors

Topics: Developer Forum, Project Management Forum, User Forum
Sep 17, 2008 at 4:12 PM
in private static void StartComponents(IKernel kernel)

im getting these errors...

ComponentActivator: could not instantiate N2.Persistence.NH.SessionProvider

ComponentActivator: could not instantiate N2.Web.MultipleSitesParser

each of these errors can be overcome by settings 1:) caching=false in the config and 2:) setting multipleSites=false in the config.

I'm guessing windsor isn't working.

If it is worth to note: I have took out all the class files in the wwwroot and moved them to an external assembly, leaving the views/parts/layouts in the wwwroot.
Coordinator
Sep 17, 2008 at 7:12 PM
I'm afraid the error is somewhere in N2, not windsor. I've fixed a problem that could manifest itself the way you describe. Could you post a stack trace?

Good approach about the class files. There is a msbuild script that does this. It's invoked by Deploy_Everything-vs2008.bat. The files are then copied to output/templates/wwwroot
Sep 18, 2008 at 3:48 AM
Edited Sep 18, 2008 at 3:49 AM
This is what happens when I set cache=true. I couldnt replicate the error for the multiplesites=true.

"   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, Object[] arguments, Type[] signature)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext context, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context, Type[]& signature)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Handlers.DefaultGenericHandler.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext context, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context, Type[]& signature)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveServiceDependency(CreationContext context, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context, Type[]& signature)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context)\r\n   at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments)\r\n   at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service)\r\n   at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler)\r\n   at Castle.MicroKernel.DefaultKernel.get_Item(String key)\r\n   at N2.Engine.ContentEngine.StartComponents(IKernel kernel)\r\n   at N2.Engine.ContentEngine.Initialize()\r\n   at N2.Context.Initialize(Boolean forceRecreate)\r\n   at N2.Web.InitializerModule.Init(HttpApplication context)\r\n   at System.Web.HttpApplication.InitModulesCommon()\r\n   at System.Web.HttpApplication.InitModules()\r\n   at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)"


Sorry for the bloated text. I would of showed you the rendered html of the error page, but an n2item type of error got thrown which im guessing was a result of this error.
Sep 18, 2008 at 5:07 AM
Found the problem for the caching.

I forgot to add a reference to the NHibernate syscache assembly. I didn't occur to me that the wwwroot which runs N2.dll would need to have some dependencies N2 uses.

DOH!!

Programming is a learning experience.  This is my only excuse, if that is what it is.   ;)