我已经下载并安装了NServiceBus 4.0,但是当公交车启动时我遇到了一些困难......
2013-09-18 15:53:40,887 [1] WARN NServiceBus.Persistence.Raven.RavenUserInstall 呃[(null)]<(null)> - 无法将用户添加到raven。处理将继续 System.MissingMethodException:找不到方法:'Raven.Abstractions.Data.PutRes ult Raven.Client.Connection.IDatabaseCommands.Put(System.String,System.Nullable `1,Raven.Json.Linq.RavenJObject,Raven.Json.Linq.RavenJObject)'。 在NServiceBus.Persistence.Raven.RavenUserInstaller.AddUserToDatabase(String 身份,DocumentStore documentStore) 在NServiceBus.Persistence.Raven.RavenUserInstaller.Install(字符串标识) 在c:\ BuildAgent \ work \ d4de8921a0aabf04 \ src \ NServiceBus.Core \ Persistence \ Raven \ Ra venUserInstaller.cs:第40行
当我尝试将更改保留到文档存储区时...
public class RavenUnitOfWork: IManageUnitsOfWork
{
public IDocumentSession Session { get; set; }
public void Begin()
{
}
public void End(Exception ex = null)
{
if (ex == null && Session != null)
{
Console.WriteLine("Saving Changes to DB.");
Session.SaveChanges();
}
}
}
produces
2013-09-18 15:57:38,007 [13] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xx
xx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failure
MessageID, Object failureMessageFormatArgument, String failureArgumentName, Exce
ption innerException)
at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result)
at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
at System.Guid..ctor(String g)
at Raven.Database.Server.AbstractRequestResponder.GetRequestTransaction(IHttp
Context context)
at Raven.Database.Server.Responders.DocumentBatch.Respond(IHttpContext contex
t)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)
---> System.Net.WebException: The remote server returned an error: (500) Intern
al Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getRespons
e) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonReque
st.cs:line 340
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unica
st\Transport\TransportReceiver.cs:line 357
at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessag
e message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\T
ransport\TransportReceiver.cs:line 235
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Trans
ports\Msmq\MsmqDequeueStrategy.cs:line 262
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in c:\BuildAgent\
work\d4de8921a0aabf04\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.c
s:line 197
2013-09-18 15:57:38,129 [29] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xx
xx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failure
MessageID, Object failureMessageFormatArgument, String failureArgumentName, Exce
ption innerException)
at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result)
at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
at System.Guid..ctor(String g)
at Raven.Database.Server.AbstractRequestResponder.GetRequestTransaction(IHttp
Context context)
at Raven.Database.Server.Responders.DocumentBatch.Respond(IHttpContext contex
t)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)
---> System.Net.WebException: The remote server returned an error: (500) Intern
al Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getRespons
e) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonReque
st.cs:line 340
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unica
st\Transport\TransportReceiver.cs:line 357
at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessag
e message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\T
ransport\TransportReceiver.cs:line 235
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Trans
ports\Msmq\MsmqDequeueStrategy.cs:line 262
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in c:\BuildAgent\
work\d4de8921a0aabf04\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.c
s:line 197
2013-09-18 15:57:38,262 [30] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
我按如下方式配置了Raven:
Configure.Instance.Configurer.ConfigureComponent<IDocumentStore>(() =>
{
var store = new DocumentStore
{
Url = "" // <-- Points to my machine at port 8080
};
store.Initialize();
store.JsonRequestFactory.DisableRequestCompression = true;
return store;
}, DependencyLifecycle.SingleInstance);
Configure.Instance.Configurer.ConfigureComponent<IDocumentSession>(() => { return Configure.Instance.Builder.Build<IDocumentStore>().OpenSession(); }, DependencyLifecycle.InstancePerUnitOfWork);
Configure.Instance.Configurer.ConfigureComponent<RavenUnitOfWork>(DependencyLifecycle.InstancePerUnitOfWork);
我在这里缺少什么?
感谢。
答案 0 :(得分:5)
答案 1 :(得分:0)
请确保您正在运行Raven v2 Raven v2.5尚未针对NServiceBus v4进行测试!
答案 2 :(得分:0)
我通过添加程序集绑定重定向来修复使用Raven Client 2.5和NServiceBus 4.4.2时获得的MissingMethodException
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Raven.Client.Lightweight" publicKeyToken="37f41c7f99471593" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>