--
You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group.
To post to this group, send email to rhino-t...@googlegroups.com.
To unsubscribe from this group, send email to rhino-tools-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
this is what I have:
in global.asax
private readonly IWindsorContainer _container;
public MvcApplication()
{
_container = new WindsorContainer(new XmlInterpreter());
new RhinoServiceBusConfiguration().UseCastleWindsor();
_container.Install(new MyWindsorInstaller());
}
in MyWindsorInstaller
public void Install(Castle.Windsor.IWindsorContainer
container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore
store)
{
container.Register(Component
.For<HomeController>().LifeStyle.PerWebRequest.ImplementedBy<HomeController>());
}
in HomeController
public HomeController(IServiceBus bus)
Unfortunately I'm getting the following exception:
Can't create component 'ElCarteroWebRole.Controllers.HomeController'
as it has dependencies to be satisfied.
ElCarteroWebRole.Controllers.HomeController is waiting for the
following dependencies:
Services:
- Rhino.ServiceBus.IServiceBus which was not registered.
Hence it looks like I'm failing to register the bus to IServiceBus in
Windsor. I thought RhinoServiceBusConfiguration will handle this, but
I'm obviously wrong. What am I missing?
Thanks!
<configuration>
<configSections>
<section name="castle"
type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler,
Castle.Windsor" />
<section name="rhino.esb"
type="Rhino.ServiceBus.Config.BusConfigurationSection,
Rhino.ServiceBus"/>
</configSections>
<rhino.esb>
<bus threadCount="1"
numberOfRetries="5"
endpoint="rhino.queues://localhost/test_queue"
queueIsolationLevel="ReadCommitted"
name="mybus"
/>
<messages>
<add name="Rhino.ServiceBus.Tests"
endpoint="msmq://localhost/test_queue"/>
<add name="Rhino.ServiceBus.Tests"
endpoint="msmq://localhost/test_queue2"/>
</messages>
</rhino.esb>
<castle/>
Thanks!
yes, in my global.asax
protected void Application_Start()
{
--> ControllerBuilder.Current.SetControllerFactory(new
WindsorControllerFactory(_container));
I was expecting that this line new
RhinoServiceBusConfiguration().UseCastleWindsor(_container).Configure();
would register IServiceBus in the container but it looks like I'm
missing something. My controllerfactory knows how to resolve
HomeController, but it
can't resolve IServiceBus
Thanks,
Juan
var bus = _container.Resolve<IServiceBus>(); yields a
[ComponentNotFoundException: No component for supporting the service
Rhino.ServiceBus.IServiceBus was found]
From the bits we've seen it seems like you have all the required
pieces, but something is amiss if you can't resolve the bus as Corey
suggested. Would you mind posting your Global.asax code? (you could
make it available as a Gist on GitHub or use a service like pastie.org
to link to it and then take it down later) Perhaps by seeing it we'll
be able to help you diagnose the issue better.
Thanks,
Matt
_container = new WindsorContainer(new XmlInterpreter());
new
RhinoServiceBusConfiguration().UseCastleWindsor(_container).Configure();
to Application_Start fixed it.
Thank you all for your responses and help.
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino Tools Dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rhino-tools-dev/-/GGUe-rd9l-sJ.