ParticularLabs / NServiceBus.WindowsServiceBus

NServiceBus support for Windows Service Bus as the underlying transport
0 stars 0 forks source link

When debugging an endpoint and it's queues do not exist then an exception is thrown. #5

Open CallumHibbert opened 11 years ago

CallumHibbert commented 11 years ago

I don't really get this but it happens all the time no matter what I do. If I debug an endpoint and its queues do no exist, then I get a NullReference exception from inside the NSB code base:

Object reference not set to an instance of an object.
  at NServiceBus.Unicast.Queuing.QueuesCreator.Install(String identity) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 44
  at NServiceBus.Installer`1.<InstallOtherInstallers>b__0(INeedToInstallSomething i) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 105
  at System.Collections.Generic.List`1.ForEach(Action`1 action)
  at NServiceBus.Installer`1.InstallOtherInstallers() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 104
  at NServiceBus.Installer`1.Install() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 93
  at NServiceBus.Hosting.Windows.Profiles.Handlers.WindowsInstallerRunner.Run() in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\Profiles\Handlers\WindowsInstallerRunner.cs:line 30
  at NServiceBus.Configure.<Initialize>b__14(IWantToRunWhenConfigurationIsComplete o) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 375
  at System.Collections.Generic.List`1.ForEach(Action`1 action)
  at NServiceBus.Configure.Initialize() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 374
  at NServiceBus.Configure.CreateBus() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 305
  at NServiceBus.Hosting.GenericHost.Start() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Hosting\GenericHost.cs:line 29
  at NServiceBus.Hosting.Windows.WindowsHost.Start() in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs:line 55
  at NServiceBus.Hosting.Windows.Program.<>c__DisplayClassd.<Main>b__5(WindowsHost service) in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 76
  at Topshelf.Internal.ControllerDelegates`1.StartActionObject(Object obj) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ControllerDelegates.cs:line 17
  at Topshelf.Internal.IsolatedServiceControllerWrapper`1.<>c__DisplayClass2.<set_StartAction>b__1(TService service) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 65
  at Topshelf.Internal.ServiceController`1.<.cctor>b__1(ServiceController`1 sc) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ServiceController.cs:line 35
  at Magnum.StateMachine.LambdaAction`1.Execute(T instance, Event event, Object parameter) in :line 0
  at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event event, Object parameter) in :line 0

However, if I run the endpoint without debugging then it creates the queues just fine. I'm puzzled.

andreasohlund commented 11 years ago

Installers are run automatically when you're in debug mode

On Thu, Oct 24, 2013 at 12:40 PM, CallumHibbert notifications@github.comwrote:

I don't really get this but it happens all the time no matter what I do. If I debug an endpoint and its queues do no exist, then I get a NullReference exception from inside the NSB code base:

Object reference not set to an instance of an object. at NServiceBus.Unicast.Queuing.QueuesCreator.Install(String identity) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 44 at NServiceBus.Installer1.<InstallOtherInstallers>b__0(INeedToInstallSomething i) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 105 at System.Collections.Generic.List1.ForEach(Action1 action) at NServiceBus.Installer1.InstallOtherInstallers() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 104 at NServiceBus.Installer1.Install() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Install.cs:line 93 at NServiceBus.Hosting.Windows.Profiles.Handlers.WindowsInstallerRunner.Run() in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\Profiles\Handlers\WindowsInstallerRunner.cs:line 30 at NServiceBus.Configure.<Initialize>b__14(IWantToRunWhenConfigurationIsComplete o) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 375 at System.Collections.Generic.List1.ForEach(Action1 action) at NServiceBus.Configure.Initialize() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 374 at NServiceBus.Configure.CreateBus() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Configure.cs:line 305 at NServiceBus.Hosting.GenericHost.Start() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Hosting\GenericHost.cs:line 29 at NServiceBus.Hosting.Windows.WindowsHost.Start() in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs:line 55 at NServiceBus.Hosting.Windows.Program.<>c__DisplayClassd.<Main>b__5(WindowsHost service) in c:\BuildAgent\work\d4de8921a0aabf04\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 76 at Topshelf.Internal.ControllerDelegates1.StartActionObject(Object obj) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ControllerDelegates.cs:line 17 at Topshelf.Internal.IsolatedServiceControllerWrapper1.<>c__DisplayClass2.<set_StartAction>b__1(TService service) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 65 at Topshelf.Internal.ServiceController1.<.cctor>b__1(ServiceController1 sc) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ServiceController.cs:line 35 at Magnum.StateMachine.LambdaAction1.Execute(T instance, Event event, Object parameter) in :line 0 at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event event, Object parameter) in :line 0

However, if I run the endpoint without debugging then it creates the queues just fine. I'm puzzled.

— Reply to this email directly or view it on GitHubhttps://github.com/Particular/NServiceBus.WindowsServiceBus/issues/5 .

udidahan commented 11 years ago

So we need a better exception.