我正在使用带有rabitMQ传输的Nservicebus版本6.2.0(NServiceBus.RabbitMQ版本5.0.0)。 我在处理程序中的服务总线上收到错误消息
ERROR NServiceBus.RecoverabilityExecutor将消息'34894416-ea8a-4d5a-ae41-a95e00f51a35'移动到错误队列'error',因为处理由于异常而失败: NServiceBus.MessageDeserializationException:尝试从传输消息34894416-ea8a-4d5a-ae41-a95e00f51a35中提取逻辑消息时发生错误---> NHibernate.LazyInitializationException:Initializing [Unavailable#]-无法延迟初始化集合,没有会话或会话关门了 在NHibernate.Collection.AbstractPersistentCollection.ThrowLazyInitializationException(String message)中的c:\ Source control \ Git \ nhibernate-core \ src \ NHibernate \ Collection \ AbstractPersistentCollection.cs:line 483 在NHibernate.Collection.AbstractPersistentCollection.ThrowLazyInitializationExceptionIfNotConnected()中的c:\ Source control \ Git \ nhibernate-core \ src \ NHibernate \ Collection \ AbstractPersistentCollection.cs:line 477 在NHibernate.Collection.AbstractPersistentCollection.Initialize(布尔写入)在c:\ Source control \ Git \ nhibernate-core \ src \ NHibernate \ Collection \ AbstractPersistentCollection.cs:line 465 在NHibernate.Collection.AbstractPersistentCollection.Write()在c:\ Source control \ Git \ nhibernate-core \ src \ NHibernate \ Collection \ AbstractPersistentCollection.cs:line 362中 在NHibernate.Collection.PersistentBag.Add(对象值)在c:\ Source control \ Git \ nhibernate-core \ src \ NHibernate \ Collection \ PersistentBag.cs:line 379 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList列表,JsonReader阅读器,JsonArrayContract合同,JsonProperty containerProperty,字符串ID) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader阅读器,类型objectType,JsonContract合同,JsonProperty成员,对象existValue,字符串ID) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader,Type&objectType,JsonContract&contract,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue,Object&newValue,String&id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty属性,JsonConverter属性Converter,JsonContainerContract containerContract,JsonProperty containerProperty,JsonReader阅读器,对象目标) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject,JsonReader reader,JsonObjectContract contract,JsonProperty member,String id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty属性,JsonConverter属性Converter,JsonContainerContract containerContract,JsonProperty containerProperty,JsonReader阅读器,对象目标) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject,JsonReader reader,JsonObjectContract contract,JsonProperty member,String id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty属性,JsonConverter属性Converter,JsonContainerContract containerContract,JsonProperty containerProperty,JsonReader阅读器,对象目标) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject,JsonReader reader,JsonObjectContract contract,JsonProperty member,String id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty属性,JsonConverter属性Converter,JsonContainerContract containerContract,JsonProperty containerProperty,JsonReader阅读器,对象目标) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject,JsonReader reader,JsonObjectContract contract,JsonProperty member,String id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList列表,JsonReader阅读器,JsonArrayContract合同,JsonProperty containerProperty,字符串ID) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader阅读器,类型objectType,JsonContract合同,JsonProperty成员,对象existValue,字符串ID) 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader,Type&objectType,JsonContract&contract,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue,Object&newValue,String&id)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader阅读器,Type objectType,JsonContract合同,JsonProperty成员,JsonContainerContract containerContract,JsonProperty containerMember,对象existValue)中 在Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader,Type objectType,Boolean checkAdditionalContent)中 在Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader,Type objectType) 在Newtonsoft.Json.JsonSerializer.Deserialize [T](JsonReader reader) 在C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ Incoming \ DeserializeLogicalMessagesConnector.cs:line NServiceBus.DeserializeLogicalMessagesConnector.Extract(IncomingMessage physicalMessage)处 在C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ Incoming \ DeserializeLogicalMessagesConnector.cs:line 44中的NServiceBus.DeserializeLogicalMessagesConnector.ExtractWithExceptionHandling(IncomingMessage消息)处 ---内部异常堆栈跟踪的结尾--- 在C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ Incoming \ DeserializeLogicalMessagesConnector.cs:line 48中的NServiceBus.DeserializeLogicalMessagesConnector.ExtractWithExceptionHandling(IncomingMessage消息)处 在NServiceBus.DeserializeLogicalMessagesConnector.d__1.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ Incoming \ DeserializeLogicalMessagesConnector.cs:line 29 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Audit \ InvokeAuditPipelineBehavior.cs:line 18中的NServiceBus.InvokeAuditPipelineBehavior.d__1.MoveNext() ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.UnitOfWorkBehavior.d__1.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ UnitOfWork \ UnitOfWorkBehavior.cs:行52 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.ReceivePerformanceDiagnosticsBehavior.d__2.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Performance \ Statistics \ ReceivePerformanceDiagnosticsBehavior.cs:line 40 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.MutateIncomingTransportMessageBehavior.d__1.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ MessageMutators \ MutateTransportMessage \ MutateIncomingTransportMessageBehavior.cs:line 43 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.ProcessingStatisticsBehavior.d__0.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Performance \ Statistics \ ProcessingStatisticsBehavior.cs:line 27 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.AzureServiceBus.TransactionScopeSuppressBehavior.d__0.MoveNext()中的C:\ BuildAgent \ work \ 2f57832e2eee436e \ src \ Transport \ Receiving \ TransactionScopeSuppressBehavior.cs:line 23 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.TransportReceiveToPhysicalMessageProcessingConnector.d__1.MoveNext()中位于C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ Incoming \ TransportReceiveToPhysicalMessageProcessingConnector.cs:line 37 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.MainPipelineExecutor.d__1.MoveNext()中的C:\ BuildAgent \ work \ 3206e2123f54fce4 \ src \ NServiceBus.Core \ Pipeline \ MainPipelineExecutor.cs:line 32 ---从之前引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在NServiceBus.Transport.RabbitMQ.MessagePump.d__29.MoveNext()中的C:\ BuildAgent \ work \ ef98ad7376e3379a \ src \ NServiceBus.RabbitMQ \ Receiving \ MessagePump.cs:line 249