问题描述
我已经下载并安装了 NServiceBus 4.0,但是当总线启动时我遇到了一些困难...
I've downloaded and installed NServiceBus 4.0, but I'm having some difficulty when the bus starts up...
2013-09-18 15:53:40,887 [1] 警告 NServiceBus.Persistence.Raven.RavenUserInstaller [(null)] <(null)> - 无法将用户添加到 raven.处理将继续System.MissingMethodException:找不到方法:'Raven.Abstractions.Data.PutResult Raven.Client.Connection.IDatabaseCommands.Put(System.String, System.Nullable`1,Raven.Json.Linq.RavenJObject,Raven.Json.Linq.RavenJObject)'.在 NServiceBus.Persistence.Raven.RavenUserInstaller.AddUserToDatabase(String身份,文档存储文档存储)在 NServiceBus.Persistence.Raven.RavenUserInstaller.Install(String identity)在 c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Persistence\Raven\RavenUserInstaller.cs:line 40
2013-09-18 15:53:40,887 [1] WARN NServiceBus.Persistence.Raven.RavenUserInstall er [(null)] <(null)> - Failed to add user to raven. Processing will continue System.MissingMethodException: Method not found: 'Raven.Abstractions.Data.PutRes ult Raven.Client.Connection.IDatabaseCommands.Put(System.String, System.Nullable `1, Raven.Json.Linq.RavenJObject, Raven.Json.Linq.RavenJObject)'. at NServiceBus.Persistence.Raven.RavenUserInstaller.AddUserToDatabase(String identity, DocumentStore documentStore) at NServiceBus.Persistence.Raven.RavenUserInstaller.Install(String identity) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Persistence\Raven\Ra venUserInstaller.cs:line 40
此外,当我尝试将更改保留到文档存储区时...
also when I try to persist changes to the document store...
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:
I've configured Raven as follows:
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);
我在这里遗漏了什么?
谢谢.
推荐答案
这是一个已知问题.请参阅#1518.它已在 #1551 中修复,但尚未发布.要么尝试从源代码构建自己,要么等待它包含在发布中.
It's a known issue. See #1518. It's been fixed in #1551, but hasn't yet made it into a release. Either try building yourself from source, or wait for it to be included in a release.
这篇关于NServiceBus 4.0 的 RavenDB 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!