ComponentActivator: could not instantiate

2,234 views
Skip to first unread message

cnichols

unread,
Jun 26, 2009, 11:20:39 PM6/26/09
to Castle Project Users
Hey Guys,

I'm using the Windsor controller factory in a .net mvc project and
have an error that is driving me nuts. The factory errors when
instantiating one of my controllers but works fine with the other 5
controllers. I've compared the code in the failing controller to my
working controllers and everything is the same. I checked and
rechecked my interface, repository and entity and everything looks
good.

Although the stack trace is listed below I don't suspect this is
enough information to solve the problem. Can somebody point me in the
right direction?

STACK TRACE

System.Exception was unhandled by user code
Message="GetControllerInstance:
type=ProgramProductRelationsController Message: ComponentActivator:
could not instantiate
RepFolio.Controllers.ProgramProductRelationsController"
Source="RepFolio"
StackTrace:
at WebUI.WindsorControllerFactory.GetControllerInstance(Type
controllerType) in C:\RepFolio\RepFolio\RepFolio
\WindsorControllerFactory.cs:line 53
at System.Web.Mvc.DefaultControllerFactory.CreateController
(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase
httpContext)
at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext
httpContext)
at
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest
(HttpContext httpContext)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute
()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
InnerException:

WEB.CONFIG

<component id="ProgramProductRelationsRepository"
service="DomainModel.Abstract.IProgramProductRelations,
DomainModel"

type="DomainModel.Concrete.SqlProgramProductRelationsRepository,
DomainModel"
lifestyle="PerWebRequest">
<parameters>
<connectionString>Data Source=sv2880;Initial
Catalog=RepFolio;Uid=XXX;Pwd=XXX;</connectionString>
</parameters>
</component>

cnichols

unread,
Jun 27, 2009, 12:24:49 AM6/27/09
to Castle Project Users
I figured this out. My repository didn't inherit the interface.

Thanks.
> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplicat­ion.IExecutionStep.Execute
Reply all
Reply to author
Forward
0 new messages