我正在尝试使用 nservicebus 中的一些示例开始使用 nservicle ebus。我无法得到一个简单的例子来工作。如果我遗漏了什么,请告诉我
在“RavenTimeoutPersistence”类型上调用构造函数“Void .ctor(Raven.Client.IDocumentStore)”时引发异常。
Magnum.StateMachine.StateMachineException 未处理 Message=Exception 发生在 Topshelf.Internal.ServiceController 1[[NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=3.2.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] during state Initial while handling OnStart
Source=NServiceBus.Host
StackTrace:
at Magnum.StateMachine.ExceptionActionDictionary
1.HandleException(T stateMachine, Event event, Object parameter, Exception exception) in :line 0 at Magnum.StateMachine.EventActionList 1.Execute(T stateMachine, Event event, Object parameter) in :line 0
at Magnum.StateMachine.EventActionBase
1.Execute(T instance,事件事件,对象参数)在:Magnum.StateMachine.State 的第 0 行1.RaiseEvent(T instance, BasicEvent
1 事件,对象值)在:Magnum.StateMachine.StateMachine 的第 0 行 1.Start 1.RaiseEvent(Event raised) in :line 0
at Topshelf.Internal.ServiceController
() 在 c:\Projects\TopShelfForNSB\src\Topshelf\Internal \ServiceController.cs:Topshelf.Internal.IsolatedServiceControllerWrapper 的第 77 行1.Start() in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 40
at Topshelf.Internal.ServiceControllerProxy.Start() in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ServiceControllerProxy.cs:line 47
at Topshelf.Internal.ServiceControllerProxy.Start()
at Topshelf.Internal.FacadeToIsolatedServiceController
第 134 行 InnerException:消息 = 启动端点时出现异常,已记录错误。原因:在“RavenTimeoutPersistence”类型上调用构造函数“Void .ctor(Raven.Client.IDocumentStore)”时引发异常。Source=NServiceBus.Host StackTrace:在 C:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting\GenericHost.cs 中的 NServiceBus.Hosting.GenericHost.Start() 处:NServiceBus.Hosting 的第 45 行。 c:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs 中的 Windows.WindowsHost.Start():NServiceBus.Hosting.Windows.Program.<>c_ 中的第 56 行 在类型“RavenTimeoutPersistence”上无效 .ctor(Raven.Client.IDocumentStore)'。Source=NServiceBus.Host StackTrace:在 C:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting\GenericHost.cs 中的 NServiceBus.Hosting.GenericHost.Start() 处:NServiceBus.Hosting 的第 45 行。 c:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs 中的 Windows.WindowsHost.Start():NServiceBus.Hosting.Windows.Program.<>c_ 中的第 56 行 在类型“RavenTimeoutPersistence”上无效 .ctor(Raven.Client.IDocumentStore)'。Source=NServiceBus.Host StackTrace:在 C:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting\GenericHost.cs 中的 NServiceBus.Hosting.GenericHost.Start() 处:NServiceBus.Hosting 的第 45 行。 c:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs 中的 Windows.WindowsHost.Start():NServiceBus.Hosting.Windows.Program.<>c_ 中的第 56 行DisplayClass8.b _4(WindowsHost 服务)在 c:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting.Windows\Program.cs:Topshelf.Internal.ControllerDelegates 1.StartActionObject(Object obj) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ControllerDelegates.cs:line 18
at Topshelf.Internal.IsolatedServiceControllerWrapper
1 的第 97 行。<>c_ DisplayClass2 .b _1(TService 服务)在 c:\Projects\TopShelfForNSB\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:第 65 行在 Topshelf.Internal.ServiceController 1.<.cctor>b__1(ServiceController
1 sc) 在 c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ ServiceController.cs:Magnum.StateMachine.LambdaAction 的第 35 行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: Autofac.Core.DependencyResolutionException Message=在“RavenTimeoutPersistence”类型上调用构造函数“Void .ctor(Raven.Client.IDocumentStore)”时引发异常'。Source=NServiceBus.Core StackTrace:在 Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext 上下文,IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 参数)在 Autofac.Core.Resolving.InstanceLookup 的 Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()。 b_ 6() 在 Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable 1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable 1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable
1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context) 的 1 个参数,在 Autofac.Core.Activators.Reflection.AutowiringPropertyInjector.InjectProperties(IComponentContext context, Object instance, Boolean overrideSetValues) 在 Autofac.Builder.RegistrationBuilder 3.<>c__DisplayClassd.<PropertiesAutowired>b__c(Object s, ActivatingEventArgs
1 e) 在 Autofac.Core 的 System.EventHandler 1.Invoke(Object sender, TEventArgs e)
at Autofac.Core.Registration.ComponentRegistration.RaiseActivating(IComponentContext context, IEnumerable
1 参数中键入 serviceType)。 Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.<Execute>b__6()
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1 个创建者)在 Autofac.Core.Resolving.InstanceLookup.Execute() 在 Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration 注册, IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 参数) 在 Autofac.Features.Collections.CollectionRegistrationSource.<>c _DisplayClass4。 <>c_ DisplayClass6.b _1(IComponentRegistration cr) at System.Linq.Enumerable.WhereSelectArrayIterator 2.MoveNext()
at System.Linq.Buffer
1..ctor(IEnumerable 1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) at Autofac.Features.Collections.CollectionRegistrationSource.<>c_ DisplayClass4.b _0(IComponentContext c, IEnumerable1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 个参数)在 Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 个参数)在 Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration 注册,IEnumerable 1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 个参数)在 Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration 注册, IEnumerable 1 parameters)
at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable
1 参数)在 Autofac.ResolutionExtensions.TryResolveService(IComponentContext 上下文,服务服务,IEnumerable 1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 参数)在 Autofac.ResolutionExtensions.Resolve(IComponentContext 上下文,类型 serviceType,IEnumerable 1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at NServiceBus.ObjectBuilder.Autofac.Internal.ContainerExtensions.ResolveAll(IComponentContext container, Type componentType)
at NServiceBus.ObjectBuilder.Autofac.AutofacObjectBuilder.BuildAll(Type typeToBuild)
at NServiceBus.ObjectBuilder.Common.CommonObjectBuilder.<NServiceBus.ObjectBuilder.IBuilder.BuildAll>d__1
1.MoveNext()在 System.Collections.Generic.List1..ctor(IEnumerable
1 个集合)在 System.Linq.Enumerable.ToList[TSource](IEnumerable 1 source)
at NServiceBus.Unicast.Config.StartupRunners.<Run>b__4(Object obj, EventArgs ev)
at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start(Action startupAction)
at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start()
at NServiceBus.Hosting.GenericHost.Start() in c:\TeamCity\buildAgent\work\nsb.master_8\src\hosting\NServiceBus.Hosting\GenericHost.cs:line 32
InnerException: System.Net.WebException
Message=The remote server returned an error: (401) Unauthorized.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func
1 getResponse) 在 Raven.Client.Connection.HttpJsonRequest.ReadResponseString() 在 Raven.Client.Connection.HttpJsonRequest.ExecuteRequest() 在 Raven.Client.Connection。 ServerClient.DirectPutIndex(String name, String operationUrl, Boolean overwrite, IndexDefinition definition) at Raven.Client.Connection.ServerClient.<>c_ DisplayClass34.b _33(String operationUrl) at Raven.Client.Connection.ServerClient.TryOperation[T](功能2 operation, String operationUrl, Boolean avoidThrowing, T& result)
at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func
2 操作)在 Raven.Client.Connection.ServerClient.PutIndex(字符串名称,IndexDefinition 定义,布尔覆盖)在 Raven.Client.Connection.ServerClient.PutIndex[TDocument,TReduceResult](字符串名称,IndexDefinitionBuilder`2 indexDef,布尔覆盖)在 NServiceBus.Timeout.Hosting.Windows.Persistence.RavenTimeoutPersistence..ctor(IDocumentStore 存储)InnerException: