Particular / NServiceBus.Ninject

https://docs.particular.net/nservicebus/containers/ninject
Other
0 stars 4 forks source link

"object reference not set" exception with NServiceBus 5.2.0 #3

Closed SeanFeldman closed 9 years ago

SeanFeldman commented 9 years ago

Reported by Steve Wilkinson in usergroup:

After upgrading from v5.1.3 to v5.2.0 we are now seeing the following "object reference not set" exception when starting an NSB Host.  We are using Ninject as the IoC container.

System.NullReferenceException was unhandled by user code
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=Ninject
  StackTrace:
       at Ninject.Injection.DynamicMethodInjectorFactory.EmitMethodCall(ILGenerator il, MethodInfo method)
       at Ninject.Injection.DynamicMethodInjectorFactory.Create(PropertyInfo property)
       at Ninject.Activation.Strategies.PropertyInjectionStrategy.AssignProperyOverrides(IContext context, InstanceReference reference, IList`1 propertyValues)
       at Ninject.Activation.Strategies.PropertyInjectionStrategy.Activate(IContext context, InstanceReference reference)
       at Ninject.Activation.Pipeline.<>c__DisplayClass2.<Activate>b__0(IActivationStrategy s)
       at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map[T](IEnumerable`1 series, Action`1 action)
       at Ninject.Activation.Pipeline.Activate(IContext context, InstanceReference reference)
       at Ninject.Activation.Context.ResolveInternal(Object scope)
       at Ninject.Activation.Context.Resolve()
       at Ninject.KernelBase.<>c__DisplayClass15.<Resolve>b__f(IBinding binding)
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
       at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at NServiceBus.Unicast.Queuing.QueuesCreator.Install(String identity, Configure config) in c:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 27
       at NServiceBus.Features.InstallationSupport.Starter.Run(Configure config) in c:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Installation\InstallationSupport.cs:line 75
       at NServiceBus.Configure.Initialize() in c:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Configure.cs:line 125
       at NServiceBus.Bus.Create(BusConfiguration configuration) in c:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Bus.cs:line 19
       at NServiceBus.GenericHost.PerformConfiguration(Action`1 moreConfiguration) in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 121
       at NServiceBus.GenericHost.Start() in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 70
       at NServiceBus.Hosting.Windows.WindowsHost.Start() in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\WindowsHost.cs:line 30
       at NServiceBus.Hosting.Windows.Program.<>c__DisplayClasse.<Main>b__6(WindowsHost service) in c:\BuildAgent\work\a3de8759ee491634\src\NServiceBus.Hosting.Windows\Program.cs:line 80
       at Topshelf.Internal.ControllerDelegates`1.StartActionObject(Object obj) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ControllerDelegates.cs:line 18
       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
  InnerException: 
johnsimons commented 9 years ago

@SeanFeldman something tells me that we are going to need a lot more info to diagnose this then just a stacktrace

SeanFeldman commented 9 years ago

Not an issue with ninject.

WilkoSki commented 9 years ago

@SeanFeldman, @johnsimons we've managed to get to the bottom of the issue. Essentially the problem is due to the UnicastBusConfig section containing the ForwardReceivedMessagesTo="audit" setting.

This must have been carried over from earlier versions of NSB in our solutions, however v5.1.3 doesn't manifest the issue where v5.2.0 does.

Looking at the auditing config documentation it would appear that this setting was from v3.x and it's not intended to be used in v.5x. So it's a non-issue.