我正在尝试使用来自nservicebus的一些样本开始使用nservicle ebus。我无法得到一个简单的例子。如果我遗失了某些内容,请告诉我
在调用构造函数' Void .ctor(Raven.Client.IDocumentStore)'时抛出异常。在类型' RavenTimeoutPersistence'。
未处理Magnum.StateMachine.StateMachineException
Message = 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事件,Object参数,Exception异常)位于:第0行
at Magnum.StateMachine.EventActionList 1.Execute(T stateMachine, Event event, Object parameter) in :line 0
at Magnum.StateMachine.EventActionBase
1.Execute(T instance,Event event,Object parameter)in:line 0
at Magnum.StateMachine.State 1.RaiseEvent(T instance, BasicEvent
1 eevent,Object value)in:第0行
在Magnum.StateMachine.StateMachine 1.RaiseEvent(Event raised) in :line 0
at Topshelf.Internal.ServiceController
1.Start()在c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Internal \ ServiceController.cs:第77行
在Topshelf.Internal.IsolatedServiceControllerWrapper 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
1.Start()在c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Internal \ FacadeToIsolatedServiceController.cs:第62行
位于c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Internal \ ServiceCoordinator.cs中的Topshelf.Internal.ServiceCoordinator.Start():第48行
在Topshelf.Internal.Hosts.ConsoleHost.Run()中的c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Internal \ Hosts \ ConsoleHost.cs:第53行
位于c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Internal \ Actions \ RunAsConsoleAction.cs中的Topshelf.Internal.Actions.RunAsConsoleAction.Do(IRunConfiguration配置):第33行
在Topshelf.Runner.Host(IRunConfiguration配置,String [] args)中的c:\ Projects \ TopShelfForNSB \ src \ Topshelf \ Runner.cs:第70行
at NServiceBus.Hosting.Windows.Program.Main(String [] args)在c:\ TeamCity \ buildAgent \ work \ nsb.master_8 \ src \ hosting \ NServiceBus.Hosting.Windows \ Program.cs:第134行
的InnerException:
Message =启动端点时出现异常,已记录错误。原因:调用构造函数' Void .ctor(Raven.Client.IDocumentStore)'时抛出异常。在类型' RavenTimeoutPersistence'。
来源= NServiceBus.Host
堆栈跟踪:
位于c:\ TeamCity \ buildAgent \ work \ nsb.master_8 \ src \ hosting \ NServiceBus.Hosting \ GenericHost.cs中的NServiceBus.Hosting.GenericHost.Start():第45行
位于c:\ TeamCity \ buildAgent \ work \ nsb.master_8 \ src \ hosting \ NServiceBus.Hosting.Windows \ WindowsHost.cs中的NServiceBus.Hosting.Windows.WindowsHost.Start():第56行
at NServiceBus.Hosting.Windows.Program。<> c_ DisplayClass8.b _4(WindowsHost服务)位于c:\ TeamCity \ buildAgent \ work \ nsb.master_8 \ src \ hosting \ NServiceBus.Hosting .Windows \ Program.cs:第97行
在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.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:第35行
在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:Autofac.Core.DependencyResolutionException
Message =在调用构造函数&#39; Void .ctor(Raven.Client.IDocumentStore)&#39;时抛出异常。在类型&#39; RavenTimeoutPersistence&#39;。
来源= NServiceBus.Core
堆栈跟踪:
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context,IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1个参数)
在Autofac.Core.Resolving.InstanceLookup.b_ 6()
在Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id,Func 1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1个参数)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration注册,IEnumerable 1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1个参数,Object&amp; instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context,Service service,IEnumerable 1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable
1个参数)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context,Type serviceType)
at 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)
在System.EventHandler 1.Invoke(Object sender, TEventArgs e)
at Autofac.Core.Registration.ComponentRegistration.RaiseActivating(IComponentContext context, IEnumerable
1个参数,Object&amp;实例)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.<Execute>b__6()
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1个创建者)
在Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope,IComponentRegistration registration,IEnumerable 1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1个参数)
at Autofac.Features.Collections.CollectionRegistrationSource。&lt;&gt; c _DisplayClass4。&lt;&gt; 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。&lt;&gt; c_ DisplayClass4.b _0(IComponentContext c,IEnumerable 1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1个参数)
at 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个参数)
at 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个参数)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context,Service service,IEnumerable 1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1个参数)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context,Type 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.List 1..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)
在Raven.Client.Connection.ServerClient。&lt;&gt; c_ DisplayClass34.b _33(String operationUrl)
在Raven.Client.Connection.ServerClient.TryOperation [T](Func 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](String name,IndexDefinitionBuilder`2 indexDef,Boolean overwrite)
在NServiceBus.Timeout.Hosting.Windows.Persistence.RavenTimeoutPersistence..ctor(IDocumentStore商店)
InnerException:
答案 0 :(得分:0)
我弄明白了这个问题。当我创建一个新的MVC项目时,添加了一个默认的连接字符串。 似乎Nservicebus认为连接字符串的存在是使用ravendb进行持久化的某种指示器等。一旦我删除它,样本开始工作